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

U will compare the 2 textboxes values i.e.username &
password with the database values by writing the following code:



cn.Open();
SqlCommand cmd = new SqlCommand("select count(*)
from compare where username='" + TextBox1.Text + "'and
password='" + TextBox2.Text + "'", cn);
int count = (int)cmd.ExecuteScalar();
cn.Close();
if (count != 0)
{
Page.RegisterStartupScript("pr",
"<script>alert('welcome to MS.Net')</script>");
}
else
{
Page.RegisterStartupScript("an",
"<script>alert('sorry')</script>");
}

Is This Answer Correct ?    16 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1208


How can we check that some changes have been made to dataset since it was loaded?

1019


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

1090


What are the key events of sqlconnection class?

1249


How to creating a SqlCommand Object?

1199


What is datatable in ado.net?

1013


How can we serialize the dataset object?

1055


Which one of the following objects is a high-level abstraction of the connection and command objects in ado.net?

1114


What is ado and dao?

1007


What is ambient transaction?

1005


What is typed dataset ?

1241


Is ado.net dead?

1063


Explain the advantage of ADO.Net?

1038


What are all the different authentication techniques used to connect to MS SQL Server?

1138


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

1105