Protected conn As MySqlConnection
Protected cmdSql As MySqlCommand
Protected strsql As String = ""
Protected rs As MySqlDataReader
connetti()
strsql = "Select id_admin from Admin where username='" & username.Text & "' and passwd='" & Replace(passwd.Text, "'", "''") & "'"
Dim idAdmin As Integer = cmdSql.ExecuteScalar
If idAdmin > 0 Then
Session("admin") = idAdmin
Response.Redirect("home.aspx")
Else
messaggio.Text = "Password o Username errati."
End If
rs = cmdSql.ExecuteReader()
rs.Close()
conn.Close()
mi da errore qui perchè:
Dim idAdmin As Integer = cmdSql.ExecuteScalar
cosa cambia nel codice ora che c'è mysql???