Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error in Step 6 - Enhancing the Orders Business Object
Message
De
15/06/2006 19:55:44
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Error in Step 6 - Enhancing the Orders Business Object
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Divers
Thread ID:
01129419
Message ID:
01129419
Vues:
58
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform