' ='附近的语法不正确vb.net

时间:2016-12-23 01:12:35

标签: sql-server visual-studio visual-studio-2013 parameters syntax-error

我在vs 2013上的SQL 2012查询中收到此错误。

我的查询:

Try
    If ComboBox1.SelectedItem = ComboBox1.Items(1) Then
        Me.TextBox1.Focus()
        cmd = New SqlCommand("Select * From Table3 where NOMBRE = " & Me.txtNombre.Text & "", Conn)
        Conn.Open()
        dr = cmd.ExecuteReader
        If dr.Read Then
            Me.txtNombre.Text = dr("Nombre")
        Else
            MessageBox.Show("El Registro no existe", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End If
        Conn.Close()
    End If
Catch ex As Exception
    MessageBox.Show(ex.Message)
End Try

有人可以提供帮助吗?我想说明一下,因为我是初学者

0 个答案:

没有答案