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 you mean by filtering of data?

732


What is data relation?

703


how can implement dropdownlist in particular of dataset when try to update?

2551


Is ado.net dead?

779


Which object holds only data and does not interact with data source?

751


How to pass multiple tables in datasets simultaneously?

825


What are dataproviders?

754


What are two types of transaction supported by ado.net?

772


What are different layers of ADO.Net?

830


Which object is used to add relationship between two Datatables?

810


What are advantages of microsoft-provided data provider classes in ado.net?

786


What is the DataTableCollection?

827


How to store data in memory?

720


What is the difference between OLEDB Provider and SqlClient?

744


Describe briefly an ADO.NET Dataset ?

771