Hi,
I need to retrieve the columns for a particluar data table in a dataset. I was able to find code to process data tables in a dataset but can not find how to process the columns for a table. Below is my code:
Dim dcDataColumn As DataColumn
cnn = New OleDbConnection(PrepareDBConnectStr(sFileName))
cnn.Open()
dtTableNames = cnn.GetSchema("Tables", strRestrictions)
'hicks
For intCounter = 0 To dtTableNames.Rows.Count - 1
Select Case dtTableNames.Rows(intCounter)(2).ToString
Case "tblSearchCriteria"
iCount = iCount + 1
Case "tblHeader"
iCount = iCount + 1
For Each dcDataColumn In dtTableNames.Rows(intCounter).Item(0)
iHeader = iHeader + 1
Next
Case Else
End Select
Next
For table "tblHeader" I want to retrieve all the columns. I think I maybe close but I am still missing a little tweaking.
Thanks!!
I need to retrieve the columns for a particluar data table in a dataset. I was able to find code to process data tables in a dataset but can not find how to process the columns for a table. Below is my code:
Dim dcDataColumn As DataColumn
cnn = New OleDbConnection(PrepareDBConnectStr(sFileName))
cnn.Open()
dtTableNames = cnn.GetSchema("Tables", strRestrictions)
'hicks
For intCounter = 0 To dtTableNames.Rows.Count - 1
Select Case dtTableNames.Rows(intCounter)(2).ToString
Case "tblSearchCriteria"
iCount = iCount + 1
Case "tblHeader"
iCount = iCount + 1
For Each dcDataColumn In dtTableNames.Rows(intCounter).Item(0)
iHeader = iHeader + 1
Next
Case Else
End Select
Next
For table "tblHeader" I want to retrieve all the columns. I think I maybe close but I am still missing a little tweaking.
Thanks!!