473,396 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Complicate question : DataSet2Class

Is there "smart" way of converting DataSet to Class ???
Nov 15 '05 #1
6 1236
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in message
news:Oq**************@TK2MSFTNGP12.phx.gbl...
Is there "smart" way of converting DataSet to Class ???

Nov 15 '05 #2
Tamir Khason wrote:
Is there "smart" way of converting DataSet to Class ???


I'm not sure I understand the question. DataSet *is* a class.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
Nov 15 '05 #3
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

"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in message
news:Oq**************@TK2MSFTNGP12.phx.gbl...
Is there "smart" way of converting DataSet to Class ???


Nov 15 '05 #4

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" <ta**********@tcon-NOSPAM.co.il>
| 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: <Oq**************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 198.211.173.74
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.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 ???
|
|
|

Nov 15 '05 #5
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...

""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:nh**************@cpmsftngxa06.phx.gbl...

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" <ta**********@tcon-NOSPAM.co.il>
| 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: <Oq**************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 198.211.173.74
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.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 ???
|
|
|

Nov 15 '05 #6

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" <ta**********@tcon-NOSPAM.co.il>
| References: <Oq**************@TK2MSFTNGP12.phx.gbl>
<nh**************@cpmsftngxa06.phx.gbl>
| 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: <Oy**************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 198.211.173.74
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.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...
|
|
|
| ""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
| news:nh**************@cpmsftngxa06.phx.gbl...
| >
| > 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" <ta**********@tcon-NOSPAM.co.il>
| > | 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: <Oq**************@TK2MSFTNGP12.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: 198.211.173.74
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.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 ???
| > |
| > |
| > |
| >
|
|
|

Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Yang Li Ke | last post by:
Hi guys! Anyone know a way so that users purchasing my scripts would not be able to share them with other people ? Yang
220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
16
by: Robbie | last post by:
Hi All This is a belter that my little brain can't handle. Basically I have 1 SQL table that contains the following fields: Stock Code Stock Desc Reference Transaction Date
1
by: Swaq | last post by:
Or, at least, I find it complicated :-) Hopefully it is not that hard but here goes: I have two tables: Persons and Relations Persons contain personal data such as person_ID, name, adresse,...
3
by: Galka | last post by:
Hello A query returns sessions missed by students. A student can miss 1, 2 or more sessions. A report based on this query prints 1 page per student, where lists missed sessions. The report should...
16
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client...
3
by: aspineux | last post by:
My goal is to write a parser for these imaginary string from the SMTP protocol, regarding RFC 821 and 1869. I'm a little flexible with the BNF from these RFC :-) Any comment ? tests= def...
12
by: George2 | last post by:
Hello everyone, Suppose we defined a string buffer (array), like this, char array = "hello world"; char buf Sometimes, I noticed that we either use,
1
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
I have a asp.net app, in client I create a Complicate json string, for example: { a: ‘a’, b : { b ; ‘b’ } } If .net has corresponding type, it could be deserialized, for example: ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.