Complicate question : DataSet2Class

  • Thread starter Thread starter Tamir Khason
  • Start date Start date
Tamir,

There is not much support for object spaces in .NET right now. Any kind
of mappings that you want to do will have to be done through a framework of
your choosing, or through a third-party framework.

Hope this helps.
 
The DataSet is a class, but I suppose you mean a Business Object?

If your architecture involves the use of Business Objects, using a DataSet
to populate them is *very* wasteful. This is because the DataSet schleps
around a lot of meta data to make up for the fact that DataSets are weakly
typed.

If you want a great book on this subject that includes very useful source
code (a complete framework) check out Visual Basic .NET Business Objects by
Rockford Lhotka (http://www.lhotka.net). All the principles in the book
apply to C# as well, and you can call his framework from C# (we do this in a
very large, commercial project).

Eric
 
Hi Tamir,

Thanks for posting in this group.
Can you express more clear?
Do you want to convert the dataset.xsd to an object or something else?

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Tamir Khason" <[email protected]>
| Subject: Complicate question : DataSet2Class
| Date: Wed, 12 Nov 2003 17:20:10 +0200
| Lines: 3
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 198.211.173.74
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:198707
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Is there "smart" way of converting DataSet to Class ???
|
|
|
 
I want to be able to build data objects for example:
TABLE USERS
user_id
user_name
user_password

I want to be able to access USERS.user_id, USERS.user_name etc WITHOUT using
datasets...
 
Hi Tamir,

I think every row in your datatable will become a class object.
So I think you should create a class in your applicaiton whose fields are
the columns of the datatable.
Then you can pass the dataset to a method.
The method can loop through all the rows in the datatable. For each row, it
creates an object instance of this class.

Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Tamir Khason" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Complicate question : DataSet2Class
| Date: Thu, 13 Nov 2003 21:09:08 +0200
| Lines: 50
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 198.211.173.74
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:199106
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| I want to be able to build data objects for example:
| TABLE USERS
| user_id
| user_name
| user_password
|
| I want to be able to access USERS.user_id, USERS.user_name etc WITHOUT
using
| datasets...
|
|
|
| | >
| > Hi Tamir,
| >
| > Thanks for posting in this group.
| > Can you express more clear?
| > Do you want to convert the dataset.xsd to an object or something else?
| >
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Tamir Khason" <[email protected]>
| > | Subject: Complicate question : DataSet2Class
| > | Date: Wed, 12 Nov 2003 17:20:10 +0200
| > | Lines: 3
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: 198.211.173.74
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:198707
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | Is there "smart" way of converting DataSet to Class ???
| > |
| > |
| > |
| >
|
|
|
 
Back
Top