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

Can we load multiple tables in a dataset?

801


What is the difference between statement and preparedstatement interface?

771


Explain the difference between an ado.net dataset and an ado recordset?

780


How do you update database through dataset?

735


How can I retrieve two tables of data at a time by using data reader? Data reader read and forward only, how is it possible to get 2 tables of data at a time?

728


How to add a javaScript function in a datagrid?

796


What is variable view?

672


What is the role of the dataset object in ado.net?

800


If a table contains 20000 records . In a page at each time 100 records to be displayed what are the steps you will take to improve performance? Will you use dataset or datareader?

834


What is microsoft ado?

702


What are the major challenges in accessing data from a database?

760


What are the core objects of ADO.NET?

790


What is the current version of entity framework?

678


How to aggregating data across related tables?

777


What are the various methods provided by the DataSet object to generate XML?

811