im trying to get the values out of my Access database, it finds the correct rows in the database (that contain the project name) but it says all the values are empty (dbnull = true) , where they are not! any ideas
thanks , the values i want are strings !
thanks , the values i want are strings !
VB.NET:
Private Sub formload()
Dim order As String
Dim fon As String
Dim pn As String
pn = InputBox("insert projectname top load")
conn.Open()
Dim strSQL As String = "SELECT * FROM form WHERE projectName = '" & pn & "'"
Dim objCommand As New System.Data.OleDb.OleDbCommand(strSQL, conn)
Dim objReader As System.Data.OleDb.OleDbDataReader
objReader = objCommand.ExecuteReader
If (conn.State = ConnectionState.Open And objReader.HasRows) Then
While objReader.Read
If objReader.IsDBNull(3) And objReader.IsDBNull(4) = False Then
order = objReader.GetString(3)
fon = objReader.GetString(4)
MsgBox(fon)
Else
MsgBox("row is null")
End If
End While
Else
MsgBox("no such project")
End If
conn.Close()
objReader.Close()
objReader = Nothing
objCommand.Dispose()
End Sub