动态选择数据库 [英] Dynamically Choose Database

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

问题描述

问候


我有几个简单的应用程序运行良好,除了一件事。

数据库似乎是硬编码的。通常我做的是进入

Settings.settings,然后将我的连接字符串的值更改为指向我想要的数据库的
,然后重新部署。每次我想要一个不同的数据库时,我必须更改此字符串

。有没有更好的方法来做这个?b $ b?也许以某种方式编程?或者是其他东西?任何提示

非常感谢..


谢谢

troy

解决方案

Troy Bull写道:


问候


我有几个简单的应用程序运行良好,除了一件事。

数据库似乎是硬编码的。通常我做的是进入

Settings.settings,然后将我的连接字符串的值更改为指向我想要的数据库的
,然后重新部署。每次我想要一个不同的数据库时,我必须更改此字符串

。有没有更好的方法来做这个?b $ b?也许以某种方式编程?或者是其他东西?任何提示

非常感谢..


谢谢

troy



有一件事我忘了说,我的第一个首选解决方案是

让我的程序只使用ODBC数据源说mysource,这样

无论如何数据库mysource指向我的应用程序将会b / b
反对的数据库。那样我就可以设置mysource了。在不同的客户端上

使用不同的默认数据库和我的应用程序加工不同的方式

无需为每个不同的客户重新部署即可使用。

" Troy Bull" < tr ******* @ gmail.com在留言中写道

news:uk ************** @ TK2MSFTNGP04.phx.gbl ...


我的首选解决方案是让我的程序只使用一个

ODBC数据源



到目前为止,ODBC是*非常古老的技术。


原生的.NET数据提供程序将以
的形式在ODBC上运行环性能......


您是否需要支持没有.NET提供程序的旧RDBMS ...?

-
< a rel =nofollowhref =http://www.markrae.nettarget =_ blank> http://www.markrae.net


Mark,


关于性能增益/损失的任何硬数据?


我倾向于相信标准10 / 100Mb网络任何差异是客户端可忽略不计的b $ b。有没有可用的尺寸?


Thx

Alex


" Mark Rae" < ma ** @ markNOSPAMrae.netwrote in message

news:eb ************** @ TK2MSFTNGP03.phx.gbl ...
< blockquote class =post_quotes>
" Troy Bull" < tr ******* @ gmail.com在留言中写道

news:uk ************** @ TK2MSFTNGP04.phx.gbl ...


>我的首选解决方案是让我的程序只使用一个
ODBC数据源



ODBC现在是*非常*老技术。


原生.NET数据提供程序将在

性能方面运行ODBC环绕。 ..


您是否需要支持没有.NET

提供商的旧RDBMS ...?


-
http://www.markrae.net



Greetings

I have several simple applications that work well, except for one thing.
The database seems to be hard coded. Normally what I do is go in to
Settings.settings, then change the value of my connect string to point
to the database I want, then redeploy. I have to change this string
every time I want a different database. Is there a better way to do
this? Maybe programatically somehow? Or something else? Any tips
greatly appreciated..

thanks
troy

解决方案

Troy Bull wrote:

Greetings

I have several simple applications that work well, except for one thing.
The database seems to be hard coded. Normally what I do is go in to
Settings.settings, then change the value of my connect string to point
to the database I want, then redeploy. I have to change this string
every time I want a different database. Is there a better way to do
this? Maybe programatically somehow? Or something else? Any tips
greatly appreciated..

thanks
troy


One thing I forgot to say, My number 1 preferred solution would be to
have my program just use an ODBC datasource say "mysource", so that
whatever database "mysource" points to is the database that my app would
go against. That way I can setup "mysource" on different client
machines different ways with different default databases and my app
would work without being redeployed for each different client.


"Troy Bull" <tr*******@gmail.comwrote in message
news:uk**************@TK2MSFTNGP04.phx.gbl...

My number 1 preferred solution would be to have my program just use an
ODBC datasource

ODBC is *extremely* old technology by now.

A native .NET data provider will run rings round ODBC in terms of
performance...

Do you need to support legacy RDBMS for which there is no .NET provider...?
--
http://www.markrae.net


Mark,

any hard data on performance gains/losses?

I am inclined to believe for standard 10/100Mb networks any difference is
negligible for client. Are any measurements available?

Thx
Alex

"Mark Rae" <ma**@markNOSPAMrae.netwrote in message
news:eb**************@TK2MSFTNGP03.phx.gbl...

"Troy Bull" <tr*******@gmail.comwrote in message
news:uk**************@TK2MSFTNGP04.phx.gbl...

>My number 1 preferred solution would be to have my program just use an
ODBC datasource


ODBC is *extremely* old technology by now.

A native .NET data provider will run rings round ODBC in terms of
performance...

Do you need to support legacy RDBMS for which there is no .NET
provider...?
--
http://www.markrae.net



这篇关于动态选择数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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