I am having one table say emp, in that i dont have any values. If i using this query “select * from emp” in the asp.net coding like below:
con.Open();
String str="select * from emp where empname='Abdul'";
cmd=new SqlCommand(str,con);
SqlDataReader dr=cmd.ExecuteReader();
while(dr.Read())
{
textBox1.text=dr[0].ToString();
textBox2.text=dr[0].ToString();
textBox3.text=dr[0].ToString();
}
con.Close();
In emp tables, i dont have any empname as abdul, When i am doing this it should show some errors, how to do it?
Do something like this:
Regards