Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error in Step 6 - Enhancing the Orders Business Object
Message
From
15/06/2006 19:55:44
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Error in Step 6 - Enhancing the Orders Business Object
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01129419
Message ID:
01129419
Views:
56
In the following code:

Private Sub pckCustomer_ItemSelected(ByVal sender As System.Object, ByVal e As OakLeaf.MM.Main.Windows.Forms.mmPickerItemSelectedEventArgs) Handles pckCustomer.ItemSelected
Me.dsOrders = Me.oOrder.GetOrdersByCustomerID(Me.pckCustomer.Text)
Me.btnNew.Enabled = True
Me.btnDelete.Enabled = True
Me.btnCancel.Enabled = True
Me.btnSave.Enabled = True
Me.btnOrderDetailNew.Enabled = True
End Sub

the line
"Me.dsOrders = Me.oOrder.GetOrdersByCustomerID(Me.pckCustomer.Text)"
is showing the error
"Value of type 'System.Data.DataTable' cannot be converted to 'System.Data.DataSet'"

The code in the business object:
Public Function GetOrdersByCustomerID(ByVal customerID As String) As DataTable
Me.GetDataSet("SELECT * FROM Orders WHERE CustomerID = @CustomerID", _
Me.CreateParameter("@CustomerID", customerID))
Return Me.DataSet.Tables(Me.TableName)
End Function

says the function is a 'DataTable', but when I change it to 'DataSet' then I get another error in line
Return Me.DataSet.Tables(Me.TableName)
"Value of type 'System.Data.DataTable' cannot be converted to 'System.Data.DataSet'

So, where do we change the data table to a data set?

Thanks
Next
Reply
Map
View

Click here to load this message in the networking platform