473,508 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Two DataSet Updates

SMG
Hi there,
I have a dataset in memory, which is filled with 1000 records.

If the records are changed in the database, I want to reflect the changes to
the previous records that means:

Dataset 1 : Table 1 [In memory]

Id Name ReportID
1 Shailesh 001
2 gajare 002
3 Gauri 0045
4 Ravi 0009
5 Rajan 5009

After some XX duration I fire a query to database which has followings
records:

Id Name ReportID
1 New_record 01025 - New record
2 gajare 0022 - Modified record
3 Ravi 0009

Two records are deleted [Rajan, Shailesh], One is newly added by values [1
New_record 01025], and one is modified[2 gajare
0022].
Two records are not modified [ Gauri, Ravi]

I want the final dataset as follows:

Id Name ReportID
1 New_record 01025 - New record
2 gajare 0022 - Modified record
3 Gauri 0045 - same record
4 Ravi 0009 - same record
What way I can achieve this?

Thanks and regards,
Shailesh Gajare
Nov 18 '05 #1
2 1260
Two solutions.
I suppose ID is primary key.

-Use dataapdater Object to fill the dataset. Fill method of dataapdater add
or update current record in dataset. Only condition: Table must have primary
key.

-Second solution is to do it manually.

"SMG" <SM*@nodmain.com> wrote in message
news:eN**************@TK2MSFTNGP15.phx.gbl...
Hi there,
I have a dataset in memory, which is filled with 1000 records.

If the records are changed in the database, I want to reflect the changes to the previous records that means:

Dataset 1 : Table 1 [In memory]

Id Name ReportID
1 Shailesh 001
2 gajare 002
3 Gauri 0045
4 Ravi 0009
5 Rajan 5009

After some XX duration I fire a query to database which has followings
records:

Id Name ReportID
1 New_record 01025 - New record
2 gajare 0022 - Modified record
3 Ravi 0009

Two records are deleted [Rajan, Shailesh], One is newly added by values [1
New_record 01025], and one is modified[2 gajare
0022].
Two records are not modified [ Gauri, Ravi]

I want the final dataset as follows:

Id Name ReportID
1 New_record 01025 - New record
2 gajare 0022 - Modified record
3 Gauri 0045 - same record
4 Ravi 0009 - same record
What way I can achieve this?

Thanks and regards,
Shailesh Gajare

Nov 18 '05 #2

"SMG" wrote in message

Hi

Why don't you just flush the dataset and repopulate it with your query
results. Or is the query just returning the changed records?

Plus if you are deleting rows how are you going to reflect this back through
a query? I might have missed the point here slightly!! But using ADO.NET and
a strongly typed dataset this sort of thing has been implemented lots of
times.

Ian
Hi there,
I have a dataset in memory, which is filled with 1000 records.

If the records are changed in the database, I want to reflect the changes to the previous records that means:

Dataset 1 : Table 1 [In memory]

Id Name ReportID
1 Shailesh 001
2 gajare 002
3 Gauri 0045
4 Ravi 0009
5 Rajan 5009

After some XX duration I fire a query to database which has followings
records:

Id Name ReportID
1 New_record 01025 - New record
2 gajare 0022 - Modified record
3 Ravi 0009

Two records are deleted [Rajan, Shailesh], One is newly added by values [1
New_record 01025], and one is modified[2 gajare
0022].
Two records are not modified [ Gauri, Ravi]

I want the final dataset as follows:

Id Name ReportID
1 New_record 01025 - New record
2 gajare 0022 - Modified record
3 Gauri 0045 - same record
4 Ravi 0009 - same record
What way I can achieve this?

Thanks and regards,
Shailesh Gajare

Nov 18 '05 #3

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

Similar topics

3
2699
by: Vijay Balki | last post by:
This might be a dumb question to ask. Can someone answer me with patience.. When I have a typed or un-typed dataset, the only way I can update is like below? Dim con As New...
1
1950
by: PV | last post by:
When performing a parent-child table updates using DataAdapters, the updates have to be performed in at least two passes. The deletes must be done child first, then parent. Conversely, the...
4
2603
by: Frnak McKenney | last post by:
I'm using an in-core DataSet as an image of my application's 'database' (a multi-table Access97 mdb file). Updates are made to the DataTables within the DataSet via forms with bound TextBoxes,...
4
10022
by: suzy | last post by:
hello. how can i sort data in a dataset? all the examples i have seen on msdn, etc are sorting a dataview. this works fine, but i want to return the results in xml and the dataview doesn't...
0
1964
by: JJ | last post by:
Hi, I have a DataSet that has no records in it from Database. I use this for just collecting records that I have been working on. I have a new worker dataset that goes out to database and gets a...
4
2208
by: Kenny | last post by:
Hello all, I am wondering about the memory arrangement in C#. If I am going to load, say, 20000 data rows from about 20 tables at once, where will be the data stored in my machine? All save on...
4
1754
by: paul | last post by:
Hi, Im trying to add a dataset to the app_code directory using vs2005 \ SQL2005 beta 2. When I run through the wizard I select the option to auto create new Stored Procedures (Select, update,...
4
1844
by: Peter Proost | last post by:
Hello group, what would be the best way to do the next thing: I've got a grid form with about 15000 records, when I double click a row a detail form is opened and the user can modify and save...
7
3351
by: Jean Christophe Avard | last post by:
Hi! I have a dataset that retreive all the item information from the database. I need to be able to edit them, in the dataset and in the database. I have this code, could anyone tell me if I'm...
2
2773
by: palgre | last post by:
Hi ALL, I am working in an windows based application using SQL Server 2000 as database. There are few tables (refer parent tables) in the application which are uploaded by a seprate application....
0
7227
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
7127
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...
1
7054
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
5633
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,...
0
4713
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...
0
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1564
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 ...
0
424
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.