Torna al Thread

[CODE] Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click Dim objConn As New OdbcConnection(strConn) objConn.Open() Dim strsql As String = "SELECT * FROM users where " + "user_email='" + txtEmail.Text + "' and user_password='" + txtPassword.Text + "'" Dim objCommand As New OdbcCommand(strsql, objConn) Dim objDataReader As OdbcDataReader objDataReader = objCommand.ExecuteReader(CommandBehavior.CloseConnection) If objDataReader.Read() Then If txtEmail.Text = objDataReader("user_email").ToString() AndAlso txtPassword.Text = objDataReader("user_password").ToString() Then Dim nome As String = txtEmail.Text + ":" + objDataReader("user_ruolo") FormsAuthentication.RedirectFromLoginPage(nome, False) End If Else End If objConn.Close() End Sub End Class [/CODE]
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5