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 two types of data providers does ADO.NET supply? What determines which one you should use?

952


What is the use of data grid?

912


How can we add/remove row's in "datatable" object of "dataset"?

974


Which is better ole db or odbc?

863


What is ado full form?

975


Explain sqlconnection object?

947


What are the features of ado.net?

966


How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?

931


What does adodb stand for?

986


What are the key events of sqlconnection class?

1134


Explain how to call the sql commands asynchronously in ado.net version 2.0?

895


Does entity framework use ado.net?

937


How can we add relation between tables in a dataset?

944


What is ado.net full form?

942


How to generate a single aggregate?

941