PC Review


Reply
Thread Tools Rate Thread

Dataset Multi-Table Row changes

 
 
Michael Jenck
Guest
Posts: n/a
 
      8th Nov 2005
Hi All,

After quite a bit of searching through the newsgroups I have been able
to fill a dataset with two tables using two separate datadapters.

What I need to do now is to update the records in table1 based on the
records in table2.

A simplifed example

Table1 ' When loaded Level is Hi All,

After quite a bit of searching through the newsgroups I have been able
to fill a dataset with two tables using two seperate datadapters.

What I need to do now is to update the records in table1 based on the
records in table2.

A simplifed example

Table1 ' When loaded Level is NULL
GUID|LastName|Score|TestDate |Level
0000|TEST1 | 7 | 5/6/05 | Hi All,

After quite a bit of searching through the newsgroups I have been able
to fill a dataset with two tables using two seperate datadapters.

What I need to do now is to update the records in table1 based on the
records in table2.

A simplifed example

Table1
GUID|LastName|Score|TestDate | Level |
0000|TEST1 | 7 | 5/6/05 | NULL |
0001|TEST2 | 21 | 5/6/05 | NULL |
0002|TEST3 | 15 | 5/6/05 | NULL |
etc.

Table 2
GUID|StartDate|EndDate|MinScore|MaxScore|Level |
A000|1/1/00 | NULL | 0 | 10 | Level 1 |
A001|1/1/00 | NULL | 11 | 23 | Level 2 |
A002|1/1/00 | NULL | 24 | 39 | Level 3 |
etc.
NOTE: Enddate can be NULL all other are NOT NULL
A NULL enddate means to use today as the enddate

The results I need to acheive would be:

So Table 1 would look like
GUID|LastName|Score|TestDate | Level |
0000|TEST1 | 7 | 5/6/05 | Level 1 |
0001|TEST2 | 21 | 5/6/05 | Level 2 |
0002|TEST3 | 15 | 5/6/05 | Level 2 |
etc.

My questions:
1) Is this possible through teh dataset by an SQL query?
(If I need to loop record at a time, this would take an extremely long
time as there are 8 different score to look up per record.)


2) Would I be better creating a stored procedure on the SQL server to
acomplish this.
(The goal was to offload to the client as much as processing as
possible)


Thanks in Advance,

Mike
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to join a multi table DataSet with update of a single table? Marco Castro Microsoft ADO .NET 0 7th Jul 2008 01:26 AM
Inserting Multi Table Dataset into Dataset Beach Bum Microsoft ADO .NET 1 10th Jun 2008 05:48 PM
multi table dataset and navigating between records Ohad Weiss Microsoft VB .NET 0 25th Mar 2007 08:57 PM
strongly typed multi-table dataset only fills the first table. Caleb Microsoft ADO .NET 5 6th Jul 2004 10:40 PM
Updating Multi-Table Dataset =?Utf-8?B?TWFyayBH?= Microsoft ADO .NET 4 15th Apr 2004 10:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:00 AM.