now I want the Record Id will pass to the Storeprocedure what i have made in sqlserver2005 by name sprocStaffsalary i want the variable RecordId will pass to that procedure and for select statement i have wrote using that RecordId varible it will fetch.
can you tell what exactly you need here. from your above post i get cleared is, your getting the recordid from the selectedindexchange event right. After this you have a write a routine to connect the sqlserver using sqlconnection after this create a sqlcommand
or sqldataadopter to fetch the records. If you need more help pls add your code and what exactly you want to do .....
be cool ....
Thanks & Regards,
Prakash
http://prakash84slm.blogspot.com
Remember to click “Mark as Answer” on the post, if it helps you.
can you tell what exactly you need here. from your above post i get cleared is, your getting the recordid from the selectedindexchange event right. After this you have a write a routine to connect the sqlserver using sqlconnection after this create a sqlcommand
or sqldataadopter to fetch the records. If you need more help pls add your code and what exactly you want to do .....
be cool ....
Thanks & Regards,
Prakash
http://prakash84slm.blogspot.com
Remember to click “Mark as Answer” on the post, if it helps you.
now I want the Record Id will pass to the Storeprocedure what i have made in sqlserver2005 by name sprocStaffsalary i want the variable RecordId will pass to that procedure and for select statement i have wrote using that RecordId varible it will fetch.
Here is the link check this out in this you have a sample to retrive data from SP by passing ID.
Subhakanta
Member
256 Points
796 Posts
How to fetch record using RecordId
Feb 27, 2012 07:00 AM|LINK
Hi ForumMembers,
I have a Gridview and i wata particular record for taht i am using
Protected void Gridview1_selectedIndexchange(object Sender,EventArgs e)
{
String RecordId=Gridview1.SelectedRow.cell[1].text;
}
now I want the Record Id will pass to the Storeprocedure what i have made in sqlserver2005 by name sprocStaffsalary i want the variable RecordId will pass to that procedure and for select statement i have wrote using that RecordId varible it will fetch.
How i can do that please Help me...
Thanking You
Subhakanta
prakashslm
Member
256 Points
87 Posts
Re: How to fetch record using RecordId
Feb 28, 2012 06:17 AM|LINK
Hi,
can you tell what exactly you need here. from your above post i get cleared is, your getting the recordid from the selectedindexchange event right. After this you have a write a routine to connect the sqlserver using sqlconnection after this create a sqlcommand or sqldataadopter to fetch the records. If you need more help pls add your code and what exactly you want to do .....
Thanks & Regards,
Prakash
http://prakash84slm.blogspot.com
Remember to click “Mark as Answer” on the post, if it helps you.
prakashslm
Member
256 Points
87 Posts
Re: How to fetch record using RecordId
Feb 28, 2012 06:17 AM|LINK
Hi,
can you tell what exactly you need here. from your above post i get cleared is, your getting the recordid from the selectedindexchange event right. After this you have a write a routine to connect the sqlserver using sqlconnection after this create a sqlcommand or sqldataadopter to fetch the records. If you need more help pls add your code and what exactly you want to do .....
Thanks & Regards,
Prakash
http://prakash84slm.blogspot.com
Remember to click “Mark as Answer” on the post, if it helps you.
vinay13mar
Star
7756 Points
1626 Posts
Re: How to fetch record using RecordId
Feb 28, 2012 06:28 AM|LINK
Hi ,
as u have written for getting the row id is correnct now use the below code to get the value
Protected void Gridview1_selectedIndexchange(object Sender,EventArgs e) { String RecordId=Gridview1.SelectedRow.cell[1].text; string sql = "your stored procedure name"; SqlDataAdapter da = new SqlDataAdapter(sql, "your connection string"); DataSet ds = new DataSet(); da.SelectCommand.CommandType = CommandType.StoredProcedure; da.SelectCommand.Parameters.AddWithValue("@RecordId", RecordId); da.Fill(ds); }now bind the dataset value to other grid view or assign to other control
V.K.Singh
shivv
Participant
1566 Points
283 Posts
Re: How to fetch record using RecordId
Feb 28, 2012 06:30 AM|LINK
Here is the link check this out in this you have a sample to retrive data from SP by passing ID.
http://stackoverflow.com/questions/3528305/how-to-use-a-dataadapter-with-stored-procedure-and-parameter