Database values....

A

atif

I m using IDataReader which contains all the recrods of the table by
the following code

dim dr as System.Data.IDataReader = returnUsers()

now i also hav a text field in which i m giving the name of user., Wat
i want to do, is to compare the database user list with the username
given in the textbox to compare whether the user with a specific name
already exists or not. Can any body tell me. Thanx


------------------------------------------------------------------------------------

Function returnUsers() As System.Data.IDataReader
Dim connectionString As String =
"Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data
Source=C:\login.mdb"
Dim dbConnection As System.Data.IDbConnection = New
System.Data.OleDb.OleDbConnection(connectionString)

Dim queryString As String = "SELECT [tblogin].[User] FROM
[tblogin]"
Dim dbCommand As System.Data.IDbCommand = New
System.Data.OleDb.OleDbCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection

dbConnection.Open
Dim dataReader As System.Data.IDataReader =
dbCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection)

Return dataReader
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,224
Latest member
BettieToom

Latest Threads

Top