i want to insert a value from loop in datarow so before entering value in datarow i want to check that a perticular column NAME exist in table or not...please tell me how can i check it.. (vb.net preferred).
A:
Try this
Dim dt As New DataTable
For Each dc As DataColumn In dt.Columns
If dc.ColumnName = "" Then
End If
Next
Anuraj
2009-12-31 10:53:50
A:
I got the answer.and its working . its:
If dr.Table.Columns.Contains("columnname") = True Then
--your work---
End If
Rajesh Rolen- DotNet Developer
2009-12-31 10:55:40
A:
A sample code to test if particular column exists in row will be:
Dim table As New DataTable()
For Each row As DataRow In table.Rows
If row.Table.Columns("name") IsNot Nothing Then
'do something
End If
Next
Adeel
2009-12-31 10:59:14