-
May 1st, 2006, 07:00 PM
#1
Thread Starter
New Member
VB.NET Newbie Need Help
Hello,
I am trying to calculate the sum of the columns and I keep getting the same error: "Object reference not set to an instance of an object." My code is listed below.
Dim ds As DataSet
Dim myTable As DataTable
'myTable = ds.Tables("Order Details")
' Declare an object variable.
'Dim objSum As Object
'objSum = ds.Tables("Order Details").Compute("Sum(UnitPrice)", "")
'lblTotalCost.Text = objSum
-
May 1st, 2006, 07:12 PM
#2
Re: VB.NET Newbie Need Help
You haven't created a DataSet object. This:declares a variable that can refer to a DataSet object but it does not create a DataSet object. You need to invoke the constructor with the New keyword:I suggest that you follow the Start VB.NET tutorial link in my signature and read at least the OOP section.
-
May 16th, 2006, 09:18 AM
#3
Thread Starter
New Member
Re: VB.NET Newbie Need Help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|