Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 provider ado.net use by default? Explain the role of data provider in ado.net?

919


Give an example that shows how to execute a stored procedure in ado.net?

1011


What is a string variable?

865


Which is faster dataset or datareader?

901


Define connection string?

1012


What is ole word?

893


How to pass values into a datatable?

1056


What is difference in record set and dataset?

988


Which is faster sqldataadapter and sqldatareader?

871


Why do we use sqldataadapter?

906


What is data access pattern?

873


How does ado.net work?

866


What is different between sqlcommand object and command behavior object?

984


What is ado net stands for?

907


What are the benefits of using of ADO.NET in .NET 4.0?

982