急需帮助,DataSet提问! [英] Need help fast, DataSet question!
本文介绍了急需帮助,DataSet提问!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将源数据库中的两个表中的数据复制到
目标数据库中的两个表中,并且表设计是相同的。
我创建了4个适配器......
2用于源db中的两个表
2用于目标db中的2个表
然后我用Source适配器填充SourceDataSet
然后我用SourceDataset更新目标适配器。
但信息没有被复制,我该怎么办?
我需要帮助,请快点!
/ Lars
I''m trying to copy data from two tables in a Source db into two Tables in a
Destination db and the Tables designa are the same.
I created 4 adapters...
2 for the two tables in the source db
2 for the 2 tables in the destination db
Then I filled a SourceDataSet with the Source adapters
and then I update the destination adapters with the SourceDataset.
But the information is not copied, what can I do???
I need help really fast, please!
/Lars
推荐答案
嗨Lars,
首先,我们也尝试从中学习新闻组,并希望得到一些关于问题的反馈。
我不知道对别人有什么看法,但当我给出答案的时候我得到了
的想法,你从来没有读过它。
回答你的问题。你对副本有什么意思,因为我得到了这个想法,因为你在谈论一个数据适配器,它不是这个
代码?
dim datasetNew as new dataset = datasetOld.copy
Cor
Hi Lars,
First of all, we try to learn as well from this newsgroup and like to have
some feedback on questions.
I don''t know how it is with others, however when I give an answer I get the
idea, that you never read it.
To give an answer on your question. What do you mean with copy because I get
the idea because you are talking about a dataadapter, that it is not this
code?
dim datasetNew as new dataset = datasetOld.copy
Cor
好的我有这段代码!
Private Sub Importdata()
尝试
dsDestination = dsSource.Copy
adpDestinationDisk.Update(dsDestination," Disktable")
adpDestinationEvent.Update(dsDestination," Eventtable")
Catch ex As Exception
MsgBox(ex.Message)
结束尝试
DataGrid2.DataSource = dsDestination
End Sub
我的数据集更新正常,但更改从未写入
数据库关联使用目标适配器。
我没有收到任何错误,更新只是似乎没有发生。但是
Datagrid显示数据集很好。
关于你写的第一个thign,你的意思是我从不说谢谢你或者你
意味着我不回答问题?
我这两个都做,但你可能已经注意到了,我不是那么好而且大多数
问题我不知道abotu如何回答。
我非常感谢我在这里得到答案,这对我帮助很大!
/ Lars
" Cor Ligthert" <无********** @ planet.nl> skrev i meddelandet
新闻:%2 **************** @ tk2msftngp13.phx.gbl ...
Okay I have this code!
Private Sub Importdata()
Try
dsDestination = dsSource.Copy
adpDestinationDisk.Update(dsDestination, "Disktable")
adpDestinationEvent.Update(dsDestination, "Eventtable")
Catch ex As Exception
MsgBox(ex.Message)
End Try
DataGrid2.DataSource = dsDestination
End Sub
I dataset is updated alright but the changes are never written into the
Database associated with the Destination adapters.
I don''t get any error, the Update Just does''nt seem to happen. But the
Datagrid shows the dataset fine.
And about the first thign you wrote, you mean I never say thank you or you
mean I don''t answer questions?
I do both, but as you probably have noticed, i''m not that good yet and most
questions I have no idea abotu how to answer.
I''m very thankful I get answers in here, it''s helping me a lot!
/Lars
"Cor Ligthert" <no**********@planet.nl> skrev i meddelandet
news:%2****************@tk2msftngp13.phx.gbl...
Hi Lars ,首先,我们也试着从这个新闻组中学习,并希望对问题有一些反馈。
我不知道怎么做它与其他人在一起,但是当我给出答案时,我得到了
这个想法,你从来没有读过它。
要回答你的问题。你是什么意思复制,因为我
得到了这个想法,因为你在谈论一个数据适配器,它不是这个代码?
dim datasetNew as new dataset = datasetOld。复制
Cor
Hi Lars,
First of all, we try to learn as well from this newsgroup and like to have
some feedback on questions.
I don''t know how it is with others, however when I give an answer I get the idea, that you never read it.
To give an answer on your question. What do you mean with copy because I get the idea because you are talking about a dataadapter, that it is not this
code?
dim datasetNew as new dataset = datasetOld.copy
Cor
嗨拉尔斯,
我是是的,第二次更新不起作用,第一次更新。
dataadapter有一个自动接受。用完整的数据集进行更改。
所以全部rowstates将被设置为已完成,您的第二次更新*应该*永远不会
工作。
如果这不能回答您的问题,请回复?
Cor
Hi Lars,
Am I right that the second update does not work and the first does.
The dataadapter has an automaticly accept.changes in it with a full dataset.
So all rowstates will be set as done and your second update *should* never
work.
If this does not answer your question, reply?
Cor
这篇关于急需帮助,DataSet提问!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文