-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
string s;
s="select * from login where username='" + TextBox1.Text + "'and password='" + TextBox2.Text + "'";
ad.SelectCommand.CommandText=s;
ds=new DataSet();
ad.Fill(ds);
if(ds.Tables[0].Rows.Count>0)
{
Label3.Text ="valid user";
}
else
Label3.Text="Invalid user";
}
Whenever i am using adapter wizard there is no error. but through coding getting error as
Object reference not set to an instance of an object.
How to rectify it?">Private void Button1_Click(object sender, System.EventArgs e) { con=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:signin.mdb;Persist Security Info=False"); string s; s="select * from login where username='" + TextBox1.Text + "'and password='" + TextBox2.Text + "'"; ad.SelectCommand.CommandText=s; ds=new DataSet(); ad.Fill(ds); if(ds.Tables[0].Rows.Count>0) { Label3.Text ="valid user"; } else Label3.Text="Invalid user"; }Whenever i am using adapter wizard there is no error. but through coding getting error as Object reference not set to an instance of an object. How to rectify it?
-
-
ASP.NET Interview Questions
Ans