I'm getting this error on a query for SQL 2012 on vs 2013.
My query:
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
Can anybody help?, I would like and example, cause i'm a beginner