LOGIN E SENHA NA ABERTURA DO PROGRAMA VB 2010
Srs. estou utilizando este codigo para verificar no Banco mysql usuario e senha mas não sei aonde esta o problema retorna o erro:
Throw New NotImplementedException
Agradeço desde já.
Imports MySql.Data.MySqlClient
Public Class Login
Inherits System.Windows.Forms.Form
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
Dim cs As String = MySqlConnection() [ô]
Dim conect As New MySqlConnection
conect.ConnectionString = cs
conect.Open()
Dim selcom As New MySqlCommand
selcom.Connection = conect
selcom.CommandText = [Ô]SELECT senha FROM login WHERE usuario=[ô][Ô] & txtusuario.Text & [Ô][ô][Ô]
Dim vsenha As String = selcom.ExecuteScalar
conect.Close()
If vsenha = txtsenha.Text Then
Principal.Show()
Me.Close()
Else
MessageBox.Show([Ô]Username ou Senha invalidos[Ô], [Ô]Login errado![Ô], MessageBoxButtons.OK, MessageBoxIcon.Warning)
txtsenha.Text = [Ô][Ô]
End If
Me.Close()
End Sub
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
Me.Close()
End Sub
Private Sub LoginForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CenterToScreen()
End Sub
Private Function MySqlConnection() As String
[txt-color=#e80000] Throw New NotImplementedException[/txt-color] End Function
End Class
Throw New NotImplementedException
Agradeço desde já.
Imports MySql.Data.MySqlClient
Public Class Login
Inherits System.Windows.Forms.Form
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
Dim cs As String = MySqlConnection() [ô]
Dim conect As New MySqlConnection
conect.ConnectionString = cs
conect.Open()
Dim selcom As New MySqlCommand
selcom.Connection = conect
selcom.CommandText = [Ô]SELECT senha FROM login WHERE usuario=[ô][Ô] & txtusuario.Text & [Ô][ô][Ô]
Dim vsenha As String = selcom.ExecuteScalar
conect.Close()
If vsenha = txtsenha.Text Then
Principal.Show()
Me.Close()
Else
MessageBox.Show([Ô]Username ou Senha invalidos[Ô], [Ô]Login errado![Ô], MessageBoxButtons.OK, MessageBoxIcon.Warning)
txtsenha.Text = [Ô][Ô]
End If
Me.Close()
End Sub
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
Me.Close()
End Sub
Private Sub LoginForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CenterToScreen()
End Sub
Private Function MySqlConnection() As String
[txt-color=#e80000] Throw New NotImplementedException[/txt-color] End Function
End Class
Experimenta excluir a função abaixo e teste novamente.
Private Function MySqlConnection() As String
Throw New NotImplementedException
End Function
De uma olhada neste exemplo que postei, talvez te ajude em algo.
Detalhe: Utilizo os usuários cadastrado no mysql.
Segue exemplo
http://www.vbmania.com.br/pages/index.php?varModulo=Detalhe&varID=8890
Detalhe: Utilizo os usuários cadastrado no mysql.
Segue exemplo
http://www.vbmania.com.br/pages/index.php?varModulo=Detalhe&varID=8890
Tópico encerrado , respostas não são mais permitidas