General information
Category:
The Mere Mortals .NET Framework
Title:
Error in Step 6 - Enhancing the Orders Business Object
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only