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