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 / suchit kumar dash

Dim con as new SqlConnection
Dim cmd as new SqlCommand
Dim dr as SqlDataReader
Dim str,str1 as String
Dim I_Int as Integer=0

PageLoad
--------------
str="Server=......;Database=......;Trusted_Connection=Yes;User
Id=sa;Password=sa;"
con=new SqlConnection(str)

Login BUtton
--------------
str1="select * from TableName where User_Name='"&
TextBox1.Text &"' and Password='" & TextBox2.Text &"'"
cmd=New SqlCommand(str1,con)
dr=cmd.ExecuteReader
while(dr.Read())
i_int=i_int+1
End while
if i=0 then
MessageBox.Show("Please Enter correct User Id and Password")
else

Endif

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the DataAdapter.Update() and DataSetAcceptChanges() methods.

1013


In how many ways we can retrieve table records count? How to find the count of records in a dataset?

1005


List the 4 common ado.net namespaces?

1163


What is the difference between dataset and datatable?

1002


What is a dataview?

970


Does dapper use ado.net?

1015


How to Read, Add, Update and Delete record in Entity Framework ?

1038


Describe the command object and its method.

997


What are dcl commands?

1009


What is dataadapter in ado.net?

920


How to copy the contents from one table to another table and how to delete the source table in ado.net?

1037


What is Serialization in .NET? what are the types of Serialization?

1073


Which object of ado contains datarow datacolumn collection?

964


What is partial class?

978


Explain the two fundamental objects in ado.net?

985