Reputation: 55
I'm new to programming. I have a form (named personal_Info) that fills some person's personal data and saves it in the database table Personal_Information
.
2nd I have another form that searches from Personal_Information
and shows results in a grid view.
I now want: When search result show in data grid view and when I double click on any row of the shown results I want (personal_info) to open and make an edit at that form and save it.
Please help me.
here is little code which gets data from sql to grid
SqlConnection strconn = new SqlConnection("server=AAG-PC; Database=humanResource; Integrated Security=sspi");
strconn.Open();
SqlCommand strcmd = new SqlCommand("select * from Personal_Information where "
+ searchComboBx.SelectedItem
+ " like '%" + txtBxKeyword.Text.Trim() + "%'", strconn);
SqlDataAdapter ad = new SqlDataAdapter(strcmd);
DataSet ds = new DataSet ();
ad.Fill(ds);
strconn.Close();
gridViewSearchResult.DataSource = ds.Tables[0];
Upvotes: 0
Views: 101