3
I would like to compare the value of a string type variable with an entire column of Datagridview.
There is a code that looks at the whole column, more or less like this
textbox.Text = datagridview.columns("nome_da_coluna").value
or I will have to create a loop for this query?
Dim sqlCmd As String = "SELECT COLUNA1, COLUNA2 FROM nome_da_tabela "
cnn = New SqlConnection(strCon)
cmd = New SqlCommand(sqlCmd, cnn)
Dim adpt As New SqlDataAdapter(sqlCmd, cnn)
Dim dts As New DataSet()
Try
cnn.Open()
adpt.Fill(dts, "nome_da_tabela")
datagridview.DataSource = dts
Fábio, good afternoon. Thank you for your information but I would like you to put an example. I know that youDatagridView.Columns("table field"). value refers to the value of the field but if you put it in the code: textbox.text = seuDatagridView.Columns("table field"). value the textbox.text does not accept the value of the datagridview field.
– rogerio.engineer
user2979215 "seuDatagridView.Columns("table field"). value" does not have the value attribute. I proposed that you implement it. What you really need is to concatenate the value of all cells in that column and assign it to the textbox.text?
– Fábio