>How I make to I know if a datacolumn exist in datatable
Here are various possibilities:
Public Function FieldExist(ByVal toDataSet As DataSet, ByVal tcTable As String, _
ByVal tcField As String) As Boolean
Dim loColumn As DataColumnCollection
loColumn = GetColumn(toDataSet, tcTable)
Return loColumn.Contains(tcField)
End Function
Public Function FieldExistFromColumn(ByVal toColumn As DataColumnCollection, ByVal tcField As String) As Boolean
Return toColumn.Contains(tcField)
End Function
Public Function FieldExist(byval toDataTable As DataTable,ByVal tcField As String) As Boolean
Dim lcFieldName As String = ""
Dim llExist As Boolean = False
Dim loRow As DataRow
For Each loRow In toDataTable.Rows
lcFieldName = loRow("ColumnName")
If UCase(lcFieldName) = UCase(tcField) Then
llExist = True
Exit For
End If
Next
Return llExist
End Function