Dunque questo è il mio codice:
Dim strConn as string = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & server.mappath("db/attivo.mdb")
Dim Conn as New OleDbConnection(strConn)
Dim strSQL as String = "SELECT * FROM UTENTI WHERE login='"& strLogin &"' and password= '"& strPw & "'"
Dim Cmd as new OleDbCommand (strSQL,Conn)
Conn.Open()
Dim objReader as OleDbDataReader = Cmd.ExecuteReader()
while objReader.Read()
Response.write(objreader.getstring(4))
End While
objreader.Clos
e questo è l'errore che mi da:
System.InvalidCastException: Specified cast is not valid.
Source Error:
...
Line 23: Response.write(objreader.getstring(4))
...
Nel db è un normalissimo campo testo e se gli faccio getfieldtype lo riconosce come stringa... è l'unico campo dove ci sono problemi...
Qualcuno mi sa aiutare?

Rispondi quotando