具有不同数据库或数据源的DataSet [英] DataSet with different Databases or Datasources

查看:155
本文介绍了具有不同数据库或数据源的DataSet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,,,,



我们可以在 DATASET 中使用不同的数据库或数据源。 ..?



请示例

解决方案

是的,你也可以使用不同的数据库/>


请参阅此解决方案或点击链接:



http://forums.asp.net/p/949947/1155679.aspx/1? Re +使用+两个+不同的+数据库+ + a + +数据集+ [ ^ ]



Re:使用两个带数据集的不同数据库?

2005年12月30日09:39 |链接



我刚刚找到了答案,它是,是的您可以使用来自不同数据库的数据填充数据集。如果您使用单个数据集的多个连接,则需要牢记以下几点:



每个数据适配器都需要用于单个连接。

您可以从多个数据库中填充数据集,但在填充表时,始终为每个数据库使用新的数据适配器和新的命令对象。

为表提供一个名称填充。恩。 dataAdapter1.Fill(dataSet1,table1)。

如果将以前的数据适配器和命令对象从database1连接回收到database2连接,则无法将多个数据库填充到单个数据集中。这是我在尝试在数据集中使用多个数据库时注意到的。


hi,



您可以使用一个数据库或每个数据集的数据源。如果您使用多个数据集/数据表,那么您可以使用不同的数据库或数据源。


没有数据集基于表的集合,通常从连接到数据库加载,这将只允许数据集中的一个数据库



是的,如果您从不同数据库中加载2个数据集并手动将表移动到1个数据集中,那么您将拥有来自不同数据集的表数据库!

Hello Friends,,,,

Can we use different databases or datasources in DATASET....?

Please anyone with example

解决方案

Yes you can use different databases as well

See this solution or follow the link:

http://forums.asp.net/p/949947/1155679.aspx/1?Re+Using+two+different+databases+with+a+dataset+[^]
OR
Re: Using two different databases with a dataset?
Dec 30, 2005 09:39 PM|LINK

I just found the answer and it is, YES you can fill a dataset with data from different databases. The following points need to be kept in mind if you are using multiple connections with a single dataset:

Each data adapter needs to be for a single connection.
You can fill a dataset from multiple databases, but while filling a table always use a new data adapter and a new command object for each database.
Give a name to the table you are filling. ex. dataAdapter1.Fill(dataSet1, "table1").
If you recycle the previous data adapter and command objects from the database1 connection to database2 connection, then you cannot populate multiple databases into a single dataset. That is what I noticed while trying to use multiple databases in a dataset.


hi,

you can use one database or datasource per one dataset. if you are using more than one dataset/datatable then you can use different database or datasource .


No a dataset is based on a collection of table, generally loaded from a connection to the database, this will allow only one database in a dataset

Yes if you take 2 datasets loaded from different databases and manually move the table into 1 dataset then you have tables from the different databases!


这篇关于具有不同数据库或数据源的DataSet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆