Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unhandled exception of type System.NullReferenceException occurred

Status
Not open for further replies.

sanders720

Programmer
Aug 2, 2001
421
US
Unhandled exception of type System.NullReferenceException occurred HERE: .DataType = System.Type.GetType

works great for second column in datatable aCol10. Actually, this column was once first, and I added one. I'm just slightly confused.

Any thoughts are apprectated!

Thanks


' Part Qty
Dim aCol0 As DataColumn
With aCol0
.DataType = System.Type.GetType("System.Integer")
.ColumnName = "QTY"
.Caption = "Quantity"
End With

' Part No.
Dim aCol10 As New DataColumn
With aCol10
.DataType = System.Type.GetType("System.String")
.ColumnName = "PN"
.Caption = "Part No."
End With
 
Is there a reason why you declare them differently? You Dim aCol0 as DataColumn and you Dim aCol10 as New DataColumn.

Rudy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top