Hi,
I have the following code which populates a DataGrid from an Excel spreadsheet.
Dim myData As New OleDbDataAdapter("SELECT [Field1], [Field1],[Field2],[Field3],[Field4],[Field5],[Field6]FROM [Sheet1$] WHERE Condition1 ORDER BY [Field1]", strConn)
myData.TableMappings.Add("Table", "Fields")
myData.Fill(myDataset)
DataGrid1.DataSource = myDataset.Tables(0).DefaultView
DataGrid1.DataBind()
The DataGrid has a page size of 10. There are 15 rows in the dataset which are displayed on the DataGrid as 10 on page 1 and the other 5 on Page 2. I want to loop through the 15 rows looking for Field1 being a specific value. How do I do this? I know I need a For Next Loop, its the syntax for the row in the Dataset thats stumped me, Any pointers would be much appreciated.
Thanks in advance.
I have the following code which populates a DataGrid from an Excel spreadsheet.
Dim myData As New OleDbDataAdapter("SELECT [Field1], [Field1],[Field2],[Field3],[Field4],[Field5],[Field6]FROM [Sheet1$] WHERE Condition1 ORDER BY [Field1]", strConn)
myData.TableMappings.Add("Table", "Fields")
myData.Fill(myDataset)
DataGrid1.DataSource = myDataset.Tables(0).DefaultView
DataGrid1.DataBind()
The DataGrid has a page size of 10. There are 15 rows in the dataset which are displayed on the DataGrid as 10 on page 1 and the other 5 on Page 2. I want to loop through the 15 rows looking for Field1 being a specific value. How do I do this? I know I need a For Next Loop, its the syntax for the row in the Dataset thats stumped me, Any pointers would be much appreciated.
Thanks in advance.