473,626 Members | 3,285 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Generating Datasets - Tricky Question


Is there any tool that generates Typed DataTables rather than Typed
Datasets? The trouble we are having is we have quite a few tables in
our database and a single table can be a part of more than one dataset.
If we use the XSD.Exe, the datatable definitions are repeated in every
dataset they appear in; causing our data definition layer to bloat.

Let us say there is a database table called Account which appears in
two dataset definitions - AccountData and TransactionData , XSD.Exe
creates two copies of Account datatable. This is very bad design as the
same underlying table is represented as different .net types.

We have looked at CodeSmith but it does not seem to provide any
out-of-the-box templates for what we are looking. We could write our
own templates but we are trying to avoid it to see if there is a better
way of coping with the problem.

Thanks.

May 11 '06 #1
4 1437
I'm assuming that the Account database table is a single table that is being
represented in 2 different DataSets. Am I correct? If so, why are you using
2 different DataSets for the same Database? A single DataSet can represent
an entire Database if desired.

It is important to note that simply creating a DataSet involves no database
interaction (other than the code creation process). Objects in the DataSet
are not populated until you say they are. In other words, there is no reason
that you should need 2 different DataSets that overlap, and in fact, this
could lead to problems with synchronization of the data across both
(disconnected) DataSets.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"S Chapman" <s_*********@ho tmail.co.uk> wrote in message
news:11******** **************@ u72g2000cwu.goo glegroups.com.. .

Is there any tool that generates Typed DataTables rather than Typed
Datasets? The trouble we are having is we have quite a few tables in
our database and a single table can be a part of more than one dataset.
If we use the XSD.Exe, the datatable definitions are repeated in every
dataset they appear in; causing our data definition layer to bloat.

Let us say there is a database table called Account which appears in
two dataset definitions - AccountData and TransactionData , XSD.Exe
creates two copies of Account datatable. This is very bad design as the
same underlying table is represented as different .net types.

We have looked at CodeSmith but it does not seem to provide any
out-of-the-box templates for what we are looking. We could write our
own templates but we are trying to avoid it to see if there is a better
way of coping with the problem.

Thanks.

May 11 '06 #2
>>there is no reason
that you should need 2 different DataSets that overlap,
<<

The above statement may not be entirely correct.

May 15 '06 #3
I agree with Kevin... you have to explain your design in more detail.
It's not clear to me why you have the same DataTable in multiple
DataSets within your data layer. I would have thought that a more usual
design would have been one DataTable (or a header / detail pair) per
data layer object, and then have the objects manage the relationships
between the different entities in your system.

Obviously there is a reason why you did what you did. Help us
understand the reasoning, and maybe we can come up with a solution to
your problem.

May 15 '06 #4
Thanks Bruce, ideally we would like to have one datatable class per
database table. We have a service based architecture in which the UI is
very loosely coupled with the middle tier. We tend to return max
information for every request. Let us say the UI requests all
transactions for a given account, we would have one dataset that
contains two datatables, one for Transactions and the other for Account
information as invariably the UI will not just display the transactions
but also some account information. Now, there might be another instance
when the UI is just updating the Account details - for this there would
be another dataset containing just the Account dataTable (and may be
additional tables for Credit and Debit card details and so on). So, we
do have situations when a DataTable appears in more than one dataset. I
hope I have explained the situation clearly.

If we use the XSD.Exe we will end up with many instances of Account
datatable class (one per dataset) which is undesirable.

May 17 '06 #5

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

Similar topics

0
2686
by: William Ryan | last post by:
At the risk of sounding like a Big 5 consultant, "It depends". 1) Strongly typed datasets rock, they are faster than untyped, use intellisense... but your reason for wanting to use them is important. I use them every day of my life, but I also don't use them every day of my life and there are reasons for both. 2) How much of your process is dependent on reads vs.
0
2219
by: linda | last post by:
I can use GD::Graph to generate a graph with two-axes by using two datasets and generate a stacked bar chart by using multiple datasets now. However, I want to generate a mixed-type graph which contains a stacked bar chart and a linespoints chart. Is this possible for me to generate the stacked bar chart by setting 'cumulate' option against the left axis and to generate the linespoints charts against the right axis simultaneously? ...
1
1523
by: Jack Notarangelo | last post by:
Hello, I am interested in anyone's preference as to creating datasets in code vs generating them using the UI. I know typing is an advantage of the latter method. But any other information would be welcome. Thanks in advance! Jack
10
1952
by: Al Christoph | last post by:
Please forgive me if this is the wrong place to post this. The last place I posted got me a fairly rude response. I guess vb.db people just don't want to think about XML as database. At any rate, here is what I posted: I have downloaded the final production version of VS 2005 pro after testing with Team version. I wonder if I've been screwed or if it's just too early on a Sunday morning. It seems to me that it was relatively trivial to...
1
2134
by: Andrew | last post by:
I'm a long time VB6/ADO and Java developer new to ADO.NET. I'm trying to decide on best practices and I'd appreciate any assistance. I have one specific question and another more general architectural one: 1. How can you pass around a disconnected DataSet/DataTable, make changes to it and then pass it into a component for update? The disconnected DataSet doesn't know it's UPDATE statement and the DataAdapter is long since gone. 2....
4
1730
by: Alpha | last post by:
I have a small Window application and through out the different forms I create a different dataset. At the begining I used the Tools to drag and drop the SqlDataAdapter, connection and dataset objects to the frist few forms but then later I removed those and created these objects in my code. I now see 3 datasets in the Solution Explorer panel part but not all the datasets that I have in my codes. Are these 3 datasets leftover from the...
3
1718
by: Rob Thomas | last post by:
Hi, I've been tasked to come up with a new architecture for a large application at one of my customer's sites. In the past, I have developed multi-tier applications whereby the business objects maintain the database using stored procedures etc and provide the data to the GUI layer via a set of objects and collections. After using the typed datasets with .NET, it appears that you van provide the same functionality as objects and...
4
1303
by: Chris Fulstow | last post by:
Hi all, I'm investigating the best approach for building an n-tier web application with ASP.NET 2.0. I want to separate my data access layer, so an ObjectDataSource seems the natural choice, but I can't decide whether to supply it data from a custom business object, or a DataSet created with the DataSet designer. Any thoughts?
4
9915
by: Ronald S. Cook | last post by:
I've always used untyped datasets. In a Microsoft course, it walks through creating typed datasets and harps on the benefits. It has you drag all these things around ..wizard, wizard, wizard... code gen, code gen, code gen. What's at the end looks slick, but then there's a ton of generated code that I'm going to have to maintain now. I.e. I like typing things myself (don't like wizards) so I can know exactly what I've done.
0
8262
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8196
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8637
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8502
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7192
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6122
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5571
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2623
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.