Dear good afternoon, I have the following dilemma, I can not do that in my system in visual basic with sql server database, at the moment of wanting to record a new datum in the table, if it exists, warn me of it, fulfilling three conditions at the same time (AND):
I only find one condition, doing it in the following way, but when I put the 3 I do not find it:
MiConexion.Open()
SQL = "SELECT COUNT(*) FROM documentos WHERE numerodocumento = '" & TextBoxNumDoc.Text & "'"
Com = New SqlCommand(SQL, MiConexion)
Rs = Com.ExecuteReader()
Rs.Read()
LabelTomaNumeroDoc.Text = Rs(0)
Rs.Close()
MiConexion.Close()
If LabelTomaNumeroDoc.Text = 0 Then
Conectar.sqlconectar()
Conectar.IngresarDoc()