Plz help me its urgent,,,,,,,,,,
I am creating a windows app. in which I have a taken a button and a datagrid view that connect to sql table
I have a text box I want if I enter a id in the text box and click the button then all the matching records should come in that datagrid view ?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Atul sharma8 reputationPosted Aug 12, 2009, 10:22 PM EDT
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Aug 12, 2009, 10:30 PM EDT
con.Open();
string strsql = "select * from Usertable where usr_int_id ="+textbox1.text+"";
OleDbCommand aCommand = new OleDbCommand(strsql, aConnection);
OleDbDataAdapter da = new OleDbDataAdapter(aCommand);
ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds;
con.Close();
// So the concept is we are passing the textbox ivalue to sql select statement to filter the exact record we want to show in datagrid view.