Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Class/Business Object Design Questions
Message
 
À
21/01/2005 09:07:14
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:
00978821
Message ID:
00979339
Vues:
7
Joe,

>I have configured this business object to use both a custom data adapter and a typed dataset.
>How can I configure the properties and accessors using this typed dataset as you suggested as option 1?

Here's some information from the upcoming MM .NET Dev Guide:

Easy Access to Typed DataRows
When a business object retrieves data it automatically stores the first DataRow of the resulting DataSet into its DataRow property. When you use strongly typed DataSets you can add a property to your business object that provides easy access to a strongly typed version of the DataRow.

For example, in C#:
public EmployeeDataSet.EmployeesRow EmployeeRow
{
	get	
	{ 
		return (EmployeeDataSet.EmployeesRow)this.DataRow; 
	}
}
And in VB .NET:
Public ReadOnly Property EmployeeRow() As EmployeeDataSet.EmployeesRow
   Get
      Return CType(Me.DataRow, EmployeeDataSet.EmployeesRow)
   End Get
End Property
So, you could create a property that references this strongly typed DataRow. For example:
public string FirstName
{
   get { return this.EmployeeRow.FirstName; }
   set { this.EmployeeRow.FirstName = value; }
}
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