Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 I NEED TO COLLECT FROM THE GRIDVIEW(DATASELECTED)

Author  Topic 

svgeorge
Starting Member

23 Posts

Posted - 2007-08-30 : 12:22:09

How TO COLLECT THE ROWS CHECKED IN CHECK BOX IN THE DATASELECTED TO ANOTHER GRID VIEW ON CLICKING BUTTON

I NEED TO COLLECT FROM THE GRIDVIEW(DATASELECTED) IN TO A TABLE(SelectedPayment)

SIMILLAR TO HOTMAIL MODEL.....CHECK THE MAILS AND BRING THE CHECKED DATA TO ANOTHER PAGE

The Question is???
How do I Create Temp table to store data in Web User Interface.
I have one main page FinancePayment.aspx(basicaly a multiview, stats view, Detail View and Review data) all as DATAGRID
all this in One main view " Data View Listing".... on stats view i have all count of ID numbers....
on clicking on numbers i get all details as name last name etc.....for all the ID of persons this is on "Detail view page" THIS IS A DATAGRID with check box selection.......then i check the Record i want and click the process payment button......so the checked data from Dataview Listing has to come to the next view that is Review data......Here i need help to get the data..how can i get the data when i have no connection with server ...and i only want to checked data on the Review data page where i finally approve and records gets inserted to database

I am having datagrids to collect data for the first page and in C# coding I have given query and now I get these data on first page.

I need help to get the selected data on Detail View to appear on the next page Review Data.

This is code i have to get data for first page...
// Not_Paid_BTM

protected void Cick_Detail_Enrollment(object sender, EventArgs e)
{
//EnrollNotPaidBTM
WebLibraryClass ConnectionFinanceDB;
ConnectionFinanceDB = new WebLibraryClass();
Button ObjectClick = (Button)sender;
string ConditionValue;
SessionValues ValueSelected = null;

ProcPaymBTM.Visible = true;
if (Session[Session_UserSPersonalData] == null)
{
ValueSelected = new SessionValues();
Session.Add(Session_UserSPersonalData, ValueSelected);
}
else
{
ValueSelected = (SessionValues)(Session[Session_UserSPersonalData]);
}

ConditionValue = ValueSelected.CONDITION;
ValueSelected.PaymentSelected = ObjectClick.ID.ToString();


if (ObjectClick.ID.ToString() == "EnrollNotPaidBTM")
{


DbDataReader CollectingDataSelected = null;
Dataviewlisting.ActiveViewIndex += 1;
try
{
CollectingDataSelected = ConnectionFinanceDB.CollectedFinaceData("SELECT DISTINCT ID, [FIRST NAME],[LAST NAME],Project_ID as [PROJECT ID],[PROJ START DT]AS ENROLLMENT,[PROJ END DT] AS TERMINATION,TERM AS [TERM CODE] FROM dbo.V_1st_Enrollment_Agency_Payment_List " + ConditionValue);
}
catch
{

}
DataTable TableSet = new DataTable();
TableSet.Load(CollectingDataSelected, LoadOption.OverwriteChanges);
DetailDataList.DataSource = TableSet.DefaultView;
DetailDataList.DataBind();
}
}

This is where the Button function is...

protected void ProcPaymBTM_Click(object sender, EventArgs e)

{

Dataviewlisting.ActiveViewIndex += 1;

int IndexCount = 0;

String ProcessingPayment;

SessionValues ValueSelected = null;

DataTable SelectedPayment = new DataTable();



if (Session[Session_UserSPersonalData] == null)

{

ValueSelected = new SessionValues();

Session.Add(Session_UserSPersonalData, ValueSelected);

}

else

{

ValueSelected = (SessionValues)(Session[Session_UserSPersonalData]);

}



ProcessingPayment = ValueSelected.PaymentSelected;

switch (ProcessingPayment)

{

case "EnollNotPaidBTM":

break;

case "PlacNotPaidBTM":

break;

case "Ret1NotPaidBTM":

break;

case "Ret3NotPaidBTM":

break;

case "Ret6NotPaidBTM":

break;

case "Place2ndNotPaidBTM":

break;

case "EnrollBonusNotPaidBTM":

break;

case "WPRNotPaidBTM":

break;

case "SatisCompleteNotPaidBTM":

break;

default:

break;

}

foreach (GridViewRow DataSelected in this.DetailDataList.Rows)

{

if (((CheckBox)DataSelected.FindControl("ApprovalCk")).Checked)

{

IndexCount += 1;

// DataTable SelectedPayment = new DataTable();

// HERE I NEED HAVE TO COLLECT THE ROWS CHECK IN THE DATASELECTED

// HOW TO COLLECT FROM THE GRIDVIEW(DATASELECTED) IN TO A TABLE(SelectedPayment)


}

}

Titlelb.Text = "Number Check is " + IndexCount.ToString() + " payment Selected " + ProcessingPayment;

}





Please suggest...OR YOU KNOW BETTER HOW TO MAKE THIS WORK...AWAITING REPLY......

Thanks

Santosh George



Please help

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2007-08-31 : 10:47:51
Interesting that you think that a "SQL Server" sire can solve this for you.....While the forum is title ASP.NET...it's really for SQL problem when called from ASP.NET....


You might be better off asking (this particular question) at an ASP.NET community site....
Go to Top of Page

svgeorge
Starting Member

23 Posts

Posted - 2007-09-05 : 14:38:17
I am using the following codes for inserting records to SQL SERVER Database table but it shows errors...please help

//---- CS file/Code behind ---

protected void ReviewSelectionGDInsert_ItemCommand(object sender, DetailsViewCommandEventArgs e)

{

if (e.CommandName.Equals("Insert"))

{

ReviewSelectionGD.Insert();

}

}

protected void ComfPaymBRM_Click(object sender,EventArgs e)

{

string SSN = ((TextBox)ReviewSelectionGD.FindControl("SSN")).Text;

string JC_ID = ((TextBox)ReviewSelectionGD.FindControl("JC_ID")).Text;

string AGENCY_ID = ((TextBox)ReviewSelectionGD.FindControl("AGENCY_ID")).Text;

string Agency_approval = ((TextBox)ReviewSelectionGD.FindControl("Agency_approval")).Text;

string Agency_approval_date = ((DropDownList)ReviewSelectionGD.FindControl("Agency_approval_date")).Text;

e.InputParameters.Add("SSN", "");

e.InputParameters.Add("JC_ID", "");

e.InputParameters.Add("AGENCY_ID", "");

e.InputParameters.Add("Agency_approval", 1);

e.InputParameters.Add("Agency_approval_date", getdate());


}

protected void ReviewSelectionGD_Inserted(object sender, ObjectDataSourceStatusEventArgs e)

{

if (e.Exception != null)

{

DivResult.Visible = true;

}

else

{

// TODO



}

}


//BLL/DAL

public static int InsertPayment(

int SSN,

int JC_ID,

int AGENCY_ID,

int Agency_approval,

DateTime Agency_approval_date


)

{

int rowsAffected = 0;

using (SqlConnection connection = ConnectionManager.GetFinanceDBConnection())

{

SqlCommand command = new SqlCommand("InsertPaymentList", connection);

command.CommandType = CommandType.StoredProcedure;

command.Parameters.Add("@SSN", SqlDbType.VarChar).Value = SSN;

command.Parameters.Add("@JC_ID", SqlDbType.VarChar).Value = JC_ID;

command.Parameters.Add("@AGENCY_ID", SqlDbType.VarChar).Value = AGENCY_ID;

command.Parameters.Add("@Agency_approval", SqlDbType.VarChar).Value = Agency_approval;

command.Parameters.Add("@Agency_approval_date", SqlDbType.datetime).Value = Agency_approval_date;


rowsAffected = command.ExecuteNonQuery();


}

return rowsAffected;

}

//stored procedure

ALTER PROCEDURE [dbo].[InsertPaymentList](

@SSN VARCHAR(50),

@JC_ID int ,

@AGENCY_ID VARCHAR(50),

@Agency_approval int,

@Agency_approval_date datetime)

AS

INSERT INTO Payment_LIST_AIMS

(SSN,JC_ID,AGENCY_ID,Agency_approval,Agency_approval_date)

VALUES

(@SSN,@JC_ID,@AGENCY_ID,@Agency_approval,@Agency_approval_date)

SET @SSN = SCOPE_IDENTITY()
Go to Top of Page
   

- Advertisement -