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

How to enable and disable connection pooling?

511


What does sqldatareader return?

502


Describe the command object and its method.

524


What is serialization and de-serialization in .net? How can we serialize the dataset object?

518


What is datatable in ado.net?

523






Explain the difference between ado and ado.net?

507


Define data adapter?

513


What are good ado.net object to replace to ado recordset object.

570


What are the rules to implement connection pooling?

509


What is data adapter in ado.net with example?

519


Explain what is datagrid with an example?

586


How to identify the controls which can be used for binding data?

551


What is the difference between an ADO.NET Dataset and an ADO Recordset?

550


What does executequery return?

519


What is aggregating data ?

513