i have two textboxes one for user name and another for
password . i have a table name compare(which contains
name,passwod etc.,)my doubt is how compare username
textbox with name column and how compare password textbox
with passwod column. i want the code

Answer Posted / srilekha

{

string s=string.Format("select * from compare where
name='{0}' and Password='{1}'",textbox1.Text,textbox2.Text);
SqlDataAdapter da=new SqlDataAdapter (s,conn);
DataTable dt=new DataTable();
da.Fill(dt);
if(dt.Rows.Count>0)
{
Lable1.text="login successfull";
}
else
{
Lable1.text="login fail";
}

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is ado.net in vb net?

494


What is the difference between OLEDB Provider and SqlClient?

523


What are the methods of XML dataset object?

611


How can we check that some changes have been made to dataset since it was loaded?

508


What is ado.net objects?

514






Explain ado.net features?

530


What is an orm, and why would you use one instead of plain old ado.net?

565


Which object of ado contains datarow datacolumn collection?

507


What are the classes in System.Data.Common Namespace?

695


What are the ado.net objects?

508


How would you connect to a database by using .NET?

471


What are the rules to implement connection pooling?

502


Compare Data Reader & Dataset in ado.net?

537


How to enable and disable connection pooling?

501


What is the difference between DataReader and DataSet in ADO.NET?

585