473,320 Members | 1,876 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,320 software developers and data experts.

Datasets - what is the best approach?

(My apologies for posting this on two forums. I have just found out the other
one was the incorrect location)

I am writing a VB.NET 2003 web application to operate on my company's
intranet. It accesses data in an SQL Server database. I have developed a
couple of pages that display data successfully. However, there is one area
that I am having trouble getting a handle on, despite purchasing a couple of
Wrox books.

Up until now, I have used a whole lot of data adapters and datasets to be
able to display my information. The data is stored in a very hierarchical
structured database. I now want to be able to edit, delete and add new
records to most of these tables. The data would be edited in datagrids.

I have seen some information that indicates that having a 'mirror-image' of
the original database stored in a dataset is the way to go, ie this is
retrieved from the database, then modified and then sent back.

My questions are:

Is it best to have a single large dataset mimicking the tables and table
structure in the database?

If so, how is this achieved effectively? I only seem to be able to bring
across a table at a time.

Any help would be greatly appreciated.

Dave.

Nov 21 '05 #1
4 1619


--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Dave" <Da**@discussions.microsoft.com> wrote in message
news:FC**********************************@microsof t.com...
(My apologies for posting this on two forums. I have just found out the other one was the incorrect location)

I am writing a VB.NET 2003 web application to operate on my company's
intranet. It accesses data in an SQL Server database. I have developed a
couple of pages that display data successfully. However, there is one area
that I am having trouble getting a handle on, despite purchasing a couple of Wrox books.

Up until now, I have used a whole lot of data adapters and datasets to be
able to display my information. The data is stored in a very hierarchical
structured database. I now want to be able to edit, delete and add new
records to most of these tables. The data would be edited in datagrids.

I have seen some information that indicates that having a 'mirror-image' of the original database stored in a dataset is the way to go, ie this is
retrieved from the database, then modified and then sent back.

My questions are:

Is it best to have a single large dataset mimicking the tables and table
structure in the database?]
---Not sure how you could avoid this if you wanted to. However - you
definitely want to keep your tables as small as possible...
If so, how is this achieved effectively? I only seem to be able to bring
across a table at a time.
Where clauses
Any help would be greatly appreciated.
If you don't need state data - you can use a datareader - but it's not a
panacea. It really depends on the situation. can you tell me a little more
about it?
Dave.

Nov 21 '05 #2
Thanks for the reply.

At the moment, it has a page which is a "Job Register", where the user
selects an "Area" from a dropdownlist, which when chosen then populates
another dropdownlist of "Departments", which when selected populates another
dropdownlist of "Sections". When the Section is chosen, it populates a
datagrid of "Masters", which when chosen populates another datagrid of
"Orders", then it populates "Items" (datagrid), then it populates
"Subscripts" (datagrid).

(The reason I used datagrids is because I can't display more than one field
in a dropdownlist and also because I want the ability to add new, update,
delete records in each of these datagrids)

Once a Subscript has been chosen, a button is selected to "Create an
Estimate", which then takes the user to another page. On this page there is
another hierarchical structure where a dropdownlist is selected, which
populates the next and so on. Once an answer is arrived at, the data can be
added to a "cart" (a datagrid). This page works well, except I am unsure how
to tackle the add new, edit, delete part of the datagrid.

My problems are mainly with the first page mentioned, where I want to add
new, update, delete records in the various datagrids. Because each datagrid
has been populated using an individual dataset, where the SQL is coded based
on the selection of the previous datagrid, I am finding it confusing with how
to then update the database and repopulate the datagrids to reflect the
changes.

Thanks for your help.

Dave.

"W.G. Ryan eMVP" wrote:


--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Dave" <Da**@discussions.microsoft.com> wrote in message
news:FC**********************************@microsof t.com...
(My apologies for posting this on two forums. I have just found out the

other
one was the incorrect location)

I am writing a VB.NET 2003 web application to operate on my company's
intranet. It accesses data in an SQL Server database. I have developed a
couple of pages that display data successfully. However, there is one area
that I am having trouble getting a handle on, despite purchasing a couple

of
Wrox books.

Up until now, I have used a whole lot of data adapters and datasets to be
able to display my information. The data is stored in a very hierarchical
structured database. I now want to be able to edit, delete and add new
records to most of these tables. The data would be edited in datagrids.

I have seen some information that indicates that having a 'mirror-image'

of
the original database stored in a dataset is the way to go, ie this is
retrieved from the database, then modified and then sent back.

My questions are:

Is it best to have a single large dataset mimicking the tables and table
structure in the database?]


---Not sure how you could avoid this if you wanted to. However - you
definitely want to keep your tables as small as possible...

If so, how is this achieved effectively? I only seem to be able to bring
across a table at a time.


Where clauses

Any help would be greatly appreciated.


If you don't need state data - you can use a datareader - but it's not a
panacea. It really depends on the situation. can you tell me a little more
about it?

Dave.


Nov 21 '05 #3
A general answer - I am sure you will get more detailed ones as well.

I like to use WHERE clauses in my SQL. As a matter of fact, I love it.
I try to retrieve only the data that is currently relevant to the task at hand.
When I am done with it, I clear my datasets.

How is this accomplished? Look into creating parameter queries.
You will have access to the parameters collection of your select
query through your dataadapter. You basically set the parameters
before executing the query. Then, only the data you need is retrieved.

You can allow a user to edit the data in the dataset and when you are
ready, post the changes back to the database using the hand update/insert/
delete queries stored in the dataadapter.

It is almost always better to retrieve as little data as needed.

Loosely coupled systems with disconnected data sources are
only one way to approach your project. It is usually the correct way.
There may be critical need for direct access to the data with locking
etc.

Also, remember, you don't have to create relationships in your
dataset. You can just use it to store the schema/data for your project
and work with the individual tables. Sometimes you need to create
the relationships. Crystal report projects with master/detail type
reports for instance. In other cases, you can just use one dataset
to store a bunch of disconnected data. You can easiy create
additional elements in your datatable schema and then bind controls
to this "hybrid" dataset.

GL - hope some of this made sense.

"Dave" <Da**@discussions.microsoft.com> wrote in message
news:FC**********************************@microsof t.com...
(My apologies for posting this on two forums. I have just found out the other
one was the incorrect location)

I am writing a VB.NET 2003 web application to operate on my company's
intranet. It accesses data in an SQL Server database. I have developed a
couple of pages that display data successfully. However, there is one area
that I am having trouble getting a handle on, despite purchasing a couple of
Wrox books.

Up until now, I have used a whole lot of data adapters and datasets to be
able to display my information. The data is stored in a very hierarchical
structured database. I now want to be able to edit, delete and add new
records to most of these tables. The data would be edited in datagrids.

I have seen some information that indicates that having a 'mirror-image' of
the original database stored in a dataset is the way to go, ie this is
retrieved from the database, then modified and then sent back.

My questions are:

Is it best to have a single large dataset mimicking the tables and table
structure in the database?

If so, how is this achieved effectively? I only seem to be able to bring
across a table at a time.

Any help would be greatly appreciated.

Dave.

Nov 21 '05 #4
Thanks for a very straightforward explanation. Well done.

I seem to still be struggling with the best place to declare the DataAdapter
and DataSet and how long the data lasts in them. Will experiment further.

Thanks again.

Dave.

"Darious Snell" wrote:
A general answer - I am sure you will get more detailed ones as well.

I like to use WHERE clauses in my SQL. As a matter of fact, I love it.
I try to retrieve only the data that is currently relevant to the task at hand.
When I am done with it, I clear my datasets.

How is this accomplished? Look into creating parameter queries.
You will have access to the parameters collection of your select
query through your dataadapter. You basically set the parameters
before executing the query. Then, only the data you need is retrieved.

You can allow a user to edit the data in the dataset and when you are
ready, post the changes back to the database using the hand update/insert/
delete queries stored in the dataadapter.

It is almost always better to retrieve as little data as needed.

Loosely coupled systems with disconnected data sources are
only one way to approach your project. It is usually the correct way.
There may be critical need for direct access to the data with locking
etc.

Also, remember, you don't have to create relationships in your
dataset. You can just use it to store the schema/data for your project
and work with the individual tables. Sometimes you need to create
the relationships. Crystal report projects with master/detail type
reports for instance. In other cases, you can just use one dataset
to store a bunch of disconnected data. You can easiy create
additional elements in your datatable schema and then bind controls
to this "hybrid" dataset.

GL - hope some of this made sense.

"Dave" <Da**@discussions.microsoft.com> wrote in message
news:FC**********************************@microsof t.com...
(My apologies for posting this on two forums. I have just found out the other
one was the incorrect location)

I am writing a VB.NET 2003 web application to operate on my company's
intranet. It accesses data in an SQL Server database. I have developed a
couple of pages that display data successfully. However, there is one area
that I am having trouble getting a handle on, despite purchasing a couple of
Wrox books.

Up until now, I have used a whole lot of data adapters and datasets to be
able to display my information. The data is stored in a very hierarchical
structured database. I now want to be able to edit, delete and add new
records to most of these tables. The data would be edited in datagrids.

I have seen some information that indicates that having a 'mirror-image' of
the original database stored in a dataset is the way to go, ie this is
retrieved from the database, then modified and then sent back.

My questions are:

Is it best to have a single large dataset mimicking the tables and table
structure in the database?

If so, how is this achieved effectively? I only seem to be able to bring
across a table at a time.

Any help would be greatly appreciated.

Dave.


Nov 21 '05 #5

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

Similar topics

0
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...
0
by: Natehop | last post by:
I've been attempting to design an n-tiered framework leveraging .NET's strongly typed Dataset. My Framework will serve as the foundation to several client apps from Windows applications to web...
45
by: cody | last post by:
I've seen an Introduction on ADO.NET with its Datasets on .NET TV and Iam now wondering how it is realized/used in real world applications. I don't believe that one would create a dataset and add...
2
by: malcolm | last post by:
Hello, We have a robust (.NET 1.1 c# winforms) client-server application that utilizes many typed DataSets, typed DataTables and typed DataRows. Our application is a series of windows and popup...
3
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...
9
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
25
by: Penelope Dramas | last post by:
Hello, I'm in a front of very serious .net redesign/rewrite of an old VB6 application. I had been asked to make it .NET 2.0 and would like to ask couple of questions regarding data access as...
4
by: Burt | last post by:
I'm working on a Windows app that pulls data from SQL Server, displays it on various forms and grids, and allows the user to update, insert, delete data. Some but not much business logic, just...
1
by: Mark Baldwin | last post by:
Steven Thanks for your reply, however the typed datasets are defined in the web service and there seems to way to open the partial class code window - double clicking on the design surface does...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.