cn.Open() For j As Integer = 0 To DataGridView1.Rows.Count - 1 Dim cmd As New SqlCommand("select Codearticle from DetailReceptionFrs where Codearticle='" & DataGridView1.Rows(j).Cells("Article").Value & "' ", cn) Using da As SqlDataReader = cmd.ExecuteReader While da.Read If da.HasRows Then Form2.Show() Else MsgBox("nnnnnnnnnn") End If End While da.Close() End Using Next
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)