ciao a tutti...allora ho questo assurdo problema.
vi posto il code
il primo comando sql lo esegue benissimo. al secondo ho questo errore e non so proprio cosa fare..codice:Dim sql As New MySqlCommand("Select * from utenti WHERE username = '" & uname.Text & "' AND pass = '" & pswd.Text & "' ", myConn) Dim rs As MySqlDataReader rs = sql.ExecuteReader() If rs.Read = "True" Then Dim nome As String nome = rs("username") nomeutente.text = nome Dim sql2 As MySqlCommand sql2 = New MySqlCommand("SELECT * FROM database WHERE id_database = " & rs("id_database") & "", myConn) 'Response.Write(aaa) Dim rs2 As MySqlDataReader rs.Close() rs2 = sql2.ExecuteReader() Session("id_utente") = rs("id_utente") Session("status") = rs("status") Session("id_database") = rs("id_database") If rs2.Read = "True" Then Session("port_db") = rs2("port_db")
dove sta l'errore ?#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database WHERE id_database = 1' at line 1
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: MySql.Data.MySqlClient.MySqlException: #42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database WHERE id_database = 1' at line 1
Source Error:
Line 26: Dim rs2 As MySqlDataReader
Line 27: rs.Close()
Line 28: rs2 = sql2.ExecuteReader()
Line 29: Session("id_utente") = rs("id_utente")
Line 30: Session("status") = rs("status")
io non riesco proprio a trovarlo...




Rispondi quotando
