Datareader problem is about to cause my death
when I try to read my datareader, it always returns empty. please help. :)
Here is my code
Dim SQL As String
Dim varresult As String
SQL = "<editied out>" 'the sql string works. returns a record when ran manually.
Dim objConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrin gs("strConnection").ConnectionString)
Dim command3 As SqlCommand = New SqlCommand(Sql, objConn)
objConn.Open()
Dim dr As SqlDataReader = command3.ExecuteReader()
If Not (dr Is Nothing) Then
Do While dr.Read
varresult = dr("SettingValue").ToString
Loop
End If
dr.Close()
objConn.Close()
|