K
KathyB
Please tell me where I'm going wrong on the marked lines***. The code
is fine to that point. I've only used this code to populate
dropdownlists using databind to the control. Here, I just need to get
the one field associated with a variable or a label control.
THANKS!
kathy
Dim Conn3 As New OleDbConnection()
Dim Rdr3 As OleDbDataReader
Dim strSQL3 As String = "SELECT Password FROM tblUsers WHERE
([UserName] = @UserName)"
Dim Cmd3 As New OleDbCommand(strSQL3, Conn3)
Conn3 = New OleDbConnection(strConn)
Dim prmUserName As OleDbParameter = New OleDbParameter("@UserName",
OleDbType.VarChar, 50)
prmUserName.Value = cboUser.SelectedItem.Value
Cmd3.Parameters.Add(prmUserName)
Cmd3.Connection = Conn3
Conn3.Open()
Rdr3 = Cmd3.ExecuteReader()
dbPass.Text = Rdr3("Password") '***what is wrong with this
line?
Dim strPass As String = Rdr3("Password") '***or what is wrong with
this line?
Rdr3.Close()
Conn3.Close()
is fine to that point. I've only used this code to populate
dropdownlists using databind to the control. Here, I just need to get
the one field associated with a variable or a label control.
THANKS!
kathy
Dim Conn3 As New OleDbConnection()
Dim Rdr3 As OleDbDataReader
Dim strSQL3 As String = "SELECT Password FROM tblUsers WHERE
([UserName] = @UserName)"
Dim Cmd3 As New OleDbCommand(strSQL3, Conn3)
Conn3 = New OleDbConnection(strConn)
Dim prmUserName As OleDbParameter = New OleDbParameter("@UserName",
OleDbType.VarChar, 50)
prmUserName.Value = cboUser.SelectedItem.Value
Cmd3.Parameters.Add(prmUserName)
Cmd3.Connection = Conn3
Conn3.Open()
Rdr3 = Cmd3.ExecuteReader()
dbPass.Text = Rdr3("Password") '***what is wrong with this
line?
Dim strPass As String = Rdr3("Password") '***or what is wrong with
this line?
Rdr3.Close()
Conn3.Close()