指定连接字符串从会话表适配器 [英] Assign connection string to table adapter from session

查看:103
本文介绍了指定连接字符串从会话表适配器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序已经开发,现在我们要改变任何存储在会话对象的连接字符串(分布式数据库管理系统的Bcoz(DDBMS))



问题就在这里......




 在该应用程序有这么多**的ObjectDataSource * *这是

与使用 .XSD
初始化文件。这是关系到
的TableAdapter 并在其中的的TableAdapter
连接字符串是从Web.config文件分配。
现在如何更改连接
串到任何存储在会话
对象?




谢谢在前进。


解决方案

要更改XSD在运行时的连接你需要设置表适配器的ConnectionModifier财产公共。如果他们通过向导创建它们将会被默认设置为好友/内部(VB / C#)。



我已经很难找到了ConnectionModifier财产(这是我VS2005文档中未列出)!如果单击XSD(其中查询是)的下方区域则应该是在属性窗口中更改可见。



然后就可以设置连接属性(它需要一个对象不是一个字符串),在任何你宣布你的表适配器。


My application is already developed and now we are going to change the connection string whatever stored in the session object (Bcoz of Distributed Database Management System (DDBMS))

Problem is here.....

In that application There are so many **ObjectDataSource** which are

initialize with the using .XSD file. which is related to the TableAdapter and in which connection string of TableAdapter is assign from the Web.Config File. Now How to change the connection string to whatever stored in session object?

Thanks in advance.

解决方案

To change the connection of an XSD at runtime you'll need to set the ConnectionModifier property of the table adapter to Public. If they're created by the "wizard" they will be set to Friend/Internal (VB/C#) by default.

I had trouble finding the ConnectionModifier property (it's not listed in my vs2005 documentation)! If you click the lower area of the XSD (where the queries are) then it should be visible in the properties window to change.

Then you can set the Connection property (it takes an object not a string) where ever you declare your table adapter.

这篇关于指定连接字符串从会话表适配器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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