Hello gurus,
I'm having a little trouble here doing something that should be relatively simple. I'm trying to add rows to a datatable programmatically. Here are my declarations:
If I try to run this I get this error:
If I change my decs to this:
I get this error:
So my question is how do I populate a datatable if I can't declare a datarow?
Many Thanks,
- VB Rookie
I'm having a little trouble here doing something that should be relatively simple. I'm trying to add rows to a datatable programmatically. Here are my declarations:
Code:
Dim dTbl As New DataTable
Dim dRow As New DataRow
'... population code follows ...
If I try to run this I get this error:
Code:
BC30390: 'System.Data.DataRow.Protected Sub New(builder As System.Data.DataRowBuilder)' is not accessible in this context because it is 'Protected'.
If I change my decs to this:
Code:
Dim dTbl As New DataTable
Dim dRow As DataRow
'... population code follows ...
I get this error:
Code:
System.NullReferenceException: Object reference not set to an instance of an object.
So my question is how do I populate a datatable if I can't declare a datarow?
Many Thanks,
- VB Rookie