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

dim qry as string = SELECT name,password FROM compare where
name = '" + txtName.text + "' AND password = '" +
txtPassword.txt + "'"

Dim ConectionString As String = "User ID=xxx;Password = yyy;
Initial Catalog='" + DataBaseName + "';Data Source=<System No>"

dim con as SqlConnection = New SqlConnection(ConectionString )
con.open

dim cmd as SqlCommand = new SqlCommand(qry,con)
dim dr as SqlDataReader = cmd.ExectueReader

if dr.HasRows = True then
messagebox.show("User ID Found")
else
messagebox.show("User ID Not Found")
end if

Above is the one example. There are various ways to validate
fox example you can write a stored procedure to validate
ID,Password and avoid SQL Injection etc.,

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which architecture does Datasets follow?

984


Which method is used to sort the data in ADO.Net?

1918


What we do with the object of ado.net dataset after using it?

948


What is aggregating data ?

909


What is row state?

924


What is concurrency? How will you avoid concurrency when dealing with dataset? (One user deleted one row after that another user through his dataset was trying to update same row. What will happen? How will you avoid the problem?)

942


What is the difference between executenonquery () and executescalar ()?

881


How to aggregating data across related tables?

974


Which name space is used to get assembly details?

921


How can we load multiple tables in a dataset?

1088


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

1010


Why is ADO.NET serialization slower than ADO ?

998


Define connection string?

1012


What is difference in record set and dataset?

988


Define ado.net?

1034