GridView2.Rows(i).Cells(3).Text
reader(0)
Public Sub checkpipno() Dim i As Integer For i = 0 To GridView1.Rows.Count - 1 Dim vr As String vr = GridView2.Rows(i).Cells(5).Text Dim village As String = GridView2.Rows(i).Cells(3).Text Dim con As New SqlConnection(connStr) con.Open() Dim sql As String = "SELECT pipno,pipcode1 FROM PIP_Entry WHERE Rpt_Unit = '" & village & "' " Dim cmd As New SqlCommand(sql, con) Dim reader As SqlDataReader = cmd.ExecuteReader() While reader.Read() If vr = reader(0).ToString() Then GridView2.Rows(i).Cells(14).Text = reader(1).ToString() GridView2.Rows(i).Cells(14).BackColor = System.Drawing.Color.FromName("Green") GridView2.Rows(i).Cells(15).Text = "Done" GridView2.Rows(i).Cells(15).BackColor = System.Drawing.Color.FromName("Green") End If End While reader.Close() con.Close() Next End Sub
'Rows' is not a member of 'System.Web.UI.WebControls.DataGrid'.
Rows
Gridview1
Gridview2
DataGrid
Items
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)