点ADO.Net数据集在运行时不同的数据库? [英] Point ADO.Net DataSet to different databases at runtime?

查看:151
本文介绍了点ADO.Net数据集在运行时不同的数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大的ADO.Net数据集和两个数据库架构(Oracle)的有不同的约束。该数据集将有两种模式工作,但我希望能够告诉它的模式使用(通过连接字符串)在运行时的数据集。

I have a large ADO.Net dataset and two database schemas (Oracle) with different constraints. The dataset will work with either schema, but I want to be able to tell the dataset which schema to use (via connection string) at runtime.

是,即使可能吗?

推荐答案

在.NET 2.0的世界里,你可以在你的表适配器在运行时更改您的连接字符串。你只需要确保的连接系统,属性是公共的,它可以从DataSet设计器来设置。

In the .Net 2.0 world, you can change your connection string on your table adapters at run-time. You just have to be sure the Connnection property is public, which can be set from the dataset designer.

这篇关于点ADO.Net数据集在运行时不同的数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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