473,400 Members | 2,145 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,400 software developers and data experts.

Update Table from another Table

Hi

I am trying to append some records form tmpSource to tmpDest table using
datasets
Tables tmpSourec and tmpDest are identical.

My setup is the following:
- daSource - data adapter for source table
- daDest - data adapter for Dest table (containing select, update, delete
and
append commands)
- dsSourceDest - generated dataset containing both Source and Dest table

I want to read data from tmpSource and put it in tmpDest like that:

'-------------------------
'-- Reading source
daSource.Fill(DsSourceDest1)
MsgBox(DsSourceDest1.Tables("tmpSource").Rows.Coun t) '-- contains
all my records

'-- trying to update the DestTable, using DsSourceDest1 (containing all my
records)
Dim i As Integer = daDest.Update(DsSourceDest1, "tmpDest")

'---------------------------

So I successfully load dsSource with a data, but daDest.Update doesn't
update the Dest table.
Can someone tell me what is wrong with this approach?
Thanks

Yakimo



Nov 21 '05 #1
3 1495
Yakimo,

Please try to avoid sending twice.

This message mainly for others that they know that this question is already
in this newsgroup and try to answer the original one if my answer is not as
they think it has to be.

Cor

"Yakimo" <ty******@nospams.no> schreef in bericht
news:uU**************@TK2MSFTNGP12.phx.gbl...
Hi

I am trying to append some records form tmpSource to tmpDest table using
datasets
Tables tmpSourec and tmpDest are identical.

My setup is the following:
- daSource - data adapter for source table
- daDest - data adapter for Dest table (containing select, update, delete
and
append commands)
- dsSourceDest - generated dataset containing both Source and Dest table

I want to read data from tmpSource and put it in tmpDest like that:

'-------------------------
'-- Reading source
daSource.Fill(DsSourceDest1)
MsgBox(DsSourceDest1.Tables("tmpSource").Rows.Coun t) '--
contains
all my records

'-- trying to update the DestTable, using DsSourceDest1 (containing all my
records)
Dim i As Integer = daDest.Update(DsSourceDest1, "tmpDest")

'---------------------------

So I successfully load dsSource with a data, but daDest.Update doesn't
update the Dest table.
Can someone tell me what is wrong with this approach?
Thanks

Yakimo


Nov 21 '05 #2
Dear Cor
I fully agree with your remarks.
The first post was by mistake - I clicked CTRL/ENTER instead of
SHIFT/Enter in order to have line break.

Unfortunately for my email client CTRL/Enter is shortcut for 'Send'.
My post was in not completed, that's why I decided to send another -
completed.

Thanks for your understanding and sorry again for that inconvenience

regards,
Yakimov

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:O%***************@TK2MSFTNGP12.phx.gbl...
Yakimo,

Please try to avoid sending twice.

This message mainly for others that they know that this question is already in this newsgroup and try to answer the original one if my answer is not as they think it has to be.

Cor

"Yakimo" <ty******@nospams.no> schreef in bericht
news:uU**************@TK2MSFTNGP12.phx.gbl...
Hi

I am trying to append some records form tmpSource to tmpDest table using
datasets
Tables tmpSourec and tmpDest are identical.

My setup is the following:
- daSource - data adapter for source table
- daDest - data adapter for Dest table (containing select, update, delete and
append commands)
- dsSourceDest - generated dataset containing both Source and Dest table

I want to read data from tmpSource and put it in tmpDest like that:

'-------------------------
'-- Reading source
daSource.Fill(DsSourceDest1)
MsgBox(DsSourceDest1.Tables("tmpSource").Rows.Coun t) '--
contains
all my records

'-- trying to update the DestTable, using DsSourceDest1 (containing all my records)
Dim i As Integer = daDest.Update(DsSourceDest1, "tmpDest")

'---------------------------

So I successfully load dsSource with a data, but daDest.Update doesn't
update the Dest table.
Can someone tell me what is wrong with this approach?
Thanks

Yakimo



Nov 21 '05 #3
Yakimo,

Have a look at this.

http://msdn.microsoft.com/library/de...gfilltopic.asp

Although still than using the merge is probably the best way.

I hope this helps,

Cor
Nov 21 '05 #4

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

Similar topics

12
by: jimserac | last post by:
I had previously posted this in an Access forum with negative results so will try here. Although this question specifies an Access database, I also wish to accomplish this with a large MS SQL...
16
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the...
18
by: Bill Smith | last post by:
The initial row is inserted with the colPartNum column containing a valid LIKE pattern, such as (without the single quotes) 'AB%DE'. I want to update the column value with the results of a query...
8
by: Maxi | last post by:
There is a lotto system which picks 21 numbers every day out of 80 numbers. I have a table (name:Lotto) with 22 fields (name:Date,P1,P2....P21) Here is the structure and sample data: ...
2
by: Miro | last post by:
I will ask the question first then fumble thru trying to explain myself so i dont waste too much of your time. Question / Statement - Every mdb table needs a PrimaryKey ( or maybe an index - i...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...

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.