开发者

List All Data Sources and Modify in Visual Studio 2008

I've taken over an ASP.NET project and the previous dev used "dynamic" DSNs sprinkled throughout the application. These data sources are databound to several controls throughout the site.

I'd prefer to use a system DSN that I would define on my dev machine and the production web server. This way if I need to change the location of the SQL database I can just change the system DSN on the server instead of modifying the code and recompiling the application in Visual Studio.

What is the easiest way to list all these dynamic DSNs that are in use in this web site project in Visual Studio 2008 and modify them to use a system DSN instead?

If you have suggestions on a more efficient way 开发者_开发知识库to handle this that would be appreciated as well.


Have you considered designing an abstract data layer library that is expected to handle all data connections to which your controls could bind directly to strongly typed structures? You could create a base class data manager that could manage connections, queries, proxies, etc. This would allow you to define these connection sources through resource files, config files, or whatever other means.

Something a co-worker and I wrote: http://www.codeproject.com/KB/database/Table_Adapters__Generics.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜