Jump to content
Fórum Script Brasil
  • 0

MySql Login = MySqlException was unhandled


Boris Wilson

Question

'Abaixo as linhas de código inseridas no Visual Studio Professional 2010 e conexão com o MySQL Server 5.0 e o MySQL Connector Net 6.4.4. os PLICS na linha de código estão as informações do breakpoint. No Data Source na opcão preview data a Tabela tb_login_usuario apresenta-se com a linha de registro. Estou trabalhando com um windons 7 64 bits.

Imports System.Data.SqlClient
Imports MySql.Data.MySqlClient
Public Class LoginForm1
    Dim MySQLConnection As MySqlConnection
    Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
        Dim cs As String = My.Settings.testConnectionString
        Dim conect As New MySqlConnection
        conect.ConnectionString = cs
        conect.Open()
        Dim selcon As New MySqlCommand
        selcon.Connection = conect
        selcon.CommandText = "SELECT nome FROM tb_login_usuario WHERE LoginForm1 = '" & UsernameTextBox.Text & "'"
        Dim nome As String = selcon.ExecuteScalar
        'nome Nothing
        'MySqlException was unhandled
        'Unknown column 'LoginForm1' in 'where clause'
        conect.Close()
        SI_Principal.Show()
        Me.Close()
    End Sub

Edited by kuroi
Adicionar tag CODE
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...