How to retrieve the selected item data from database to Gridview using C#.i past my code bellow,plz help me
private void dataGridView1_DoubleClick(object sender, EventArgs e)
{
cn = new SqlConnection("data source=server2;database=costing1;user id=sa;password=sa");
da2 = new SqlDataAdapter("select *from CATABLE001 where column002='@column002'", cn);
ds = new DataSet();
da2.MissingSchemaAction = MissingSchemaAction.AddWithKey;
da2.Fill(ds, "CATABLE001");
cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandType = CommandType.StoredProcedure;
int sno = int.Parse(Interaction.InputBox("Enter ItemCode", "db operations", "", 50, 50));
DataRow dr = ds.Tables["CATABLE001"].Rows.Find(sno);
dataGridView1.DataSource = ds.Tables["CATABLE001"];
Loading

Roei BarRank #1,271 · 1.4K reputationPosted Sep 10, 2009, 10:07 AM EDT
1. do you want it to reload the gird by grid selected cell
2. do you want to load a secondery grid by selected cell value
3. do you want a filter
roy himanshu98 reputationPosted Sep 10, 2009, 8:21 PM EDT
i have a gridview,when i double clicked gridview cell,one messagebox opened,in that message box i entered itemcode click ok button(like search option),then immideatly that item information is retrive in the same gridview.this is my requirement. my code is paste last post.plz help me.
thanx