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 / boopathiraj

sqlconnection con = new sqlconnection("");
sqlcommand cmd = new sqlcommand("select * from
table-name",con);

//write this code in the button click event
con.open();
dr = cmd.executereader();
while(dr.read())
{
if(textbox1.text==dr.getvalue(0).tostring()&&
textbox2.text==dr.getvalue(1).tostring())
{
msgbox.show("successful");
}
}
con.close();
else
{
msgbox.show("not success");
}

Is This Answer Correct ?    3 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between ado.net and oledb?

1003


What is the use of connection object in ado.net?

1091


What is the difference between linq and ado.net?

1039


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

1207


What is the default timeout specified for "sqlcommand.commandtimeout" property?

1104


What is meant by ‘transaction’ in a database and what are the ‘properties of transaction’?

1038


What is aggregating data ?

1023


What is ole in excel?

981


What is ado and rdo?

961


What is the use of SqlCommandBuilder?

1253


What is ado control?

997


Difference between sqlcommand and sqlcommandbuilder?

1190


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

1150


Which method in OLEDBAdapter is used to populate dataset with records?

1069


What is adodb dll?

1049