Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Easy Access to Typed Datasets
Message
 
À
05/05/2005 09:04:59
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01011252
Message ID:
01018334
Vues:
14
>I get the following syntax error when I created this wrapper method in my Bus Obj for GetCurrentDataSet that casts the generic DataSet to the strongly typed DataSets as written in the Dev Guide:
>GetDataSet shadows an overloadable member declared in the base class 'mmBusinessObject'. If you want to overload the base method this method must be declared 'Overloads'.
>
>Shouldn't the example (VB.NET) be coded as:
>
>' Wrapper method for GetCurrentDataSet that casts the DataSet to EmployeeDataSet
>Public Overloads Function GetDataSet() As EmployeeDataSet
> Return CType(Me.GetCurrentDataSet(), EmployeeDataSet)
>End Function
>
>Rather than:
>
>' Wrapper method for GetCurrentDataSet that casts the DataSet to EmployeeDataSet
>Public Function GetDataSet() As EmployeeDataSet
> Return CType(Me.GetCurrentDataSet(), EmployeeDataSet)
>End Function

Actually, the Dev Guide has this code:
' Wrapper method for GetCurrentDataSet that casts the DataSet to EmployeeDataSet
Public Function GetDataSet() As EmployeeDataSet
   Return CType(Me.GetCurrentDataSet(), EmployeeDataSet)
End Function
Note the method is GetDataSet(), not GetCurrentDataSet(), so there is no need for the Overrides keyword since there is no method named GetDataSet() in mmBusinessObject.

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform