By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,220 Members | 1,633 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,220 IT Pros & Developers. It's quick & easy.

Update Table from another Table

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.