Re: selecting one row from datagrid



I believe you just need to remove the @ in front of txtname.text.

rcoco wrote:
Thanks,
the whole code actually goes like this as per now hope you could hlp
me:

try
{
con.Open();
SqlCommand myCommand = new SqlCommand();
myCommand.Connection=con;
myCommand.CommandText="SELECT * from employee where fullname Like
%"+@xxxxxxxxxxxx+"%";
SqlDataAdapter myAdapter=new SqlDataAdapter(myCommand);
DataSet ds = new DataSet();
myAdapter.Fill(ds,"isp_email.staff");
con.Open();
myCommand.ExecuteNonQuery();
dgupdate.DataSource=ds;
dgupdate.DataBind();
con.Close();
}
catch(Exception err)
{
Console.WriteLine(err.Message);
}
finally
{
con.Close();
}
Thank you

.