0
Reply

what could be wrong?

Ndayahundwa Claude

Ndayahundwa Claude

Jan 9 2007 2:35 AM
1.8k
Hi,
I'm just wondering if I'm on the write truck. this code is ment to look
for an ID number in the datagrid that matches the the ID number that is
in the textbox I created.
But it's not selecting neither is it showing me any error. could some
one help me please?

private void bttok_click(object sender, System.EventArgs e)
{
SqlCommand myCommand = new SqlCommand("select * from employee where
txtname.text=id",con);
SqlDataAdapter myAdapter=new SqlDataAdapter(myCommand);
DataSet ds = new DataSet();
myAdapter.Fill(ds);
con.Open();
myCommand.ExecuteNonQuery();
datagrid1.DataSource=ds;
datagrid1.DataBind();
con.Close();

}

Thanks.