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 ?
Niradhip ChakrabortyPosted Aug 13, 2009, 2:30 AM
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.
Atul sharmaPosted Aug 13, 2009, 2:22 AM