paulhudson
Programmer
I am querying a database - the query can only have one row/cell returned. The query works fine when run against the database. What I am doing is using the result to form part of a url for a redirection. Trouble is I cannot see how you can retrieve a value without creating a bindable object.
Can anyone help me with this?
The code I have used below throws the following error "Index was outside the bounds of the array. " when I try to bind the results to a label called lblmessage
Can anyone help me with this?
The code I have used below throws the following error "Index was outside the bounds of the array. " when I try to bind the results to a label called lblmessage
Code:
sSQL = "Select ...."
Dim oConnect As New OleDbConnection(ConfigurationSettings.AppSettings("testconnString"))
Dim oCommand As New OleDbCommand(sSQL, oConnect)
Try
oConnect.Open()
lblmessage.text = oCommand.ExecuteScalar(CommandBehavior.CloseConnection)
Catch oErr As Exception
If oConnect.State <> ConnectionState.Closed Then
oConnect.Close()
End If
lblErr.Text = oErr.Message
End Try