坚持安全信息&&表适配器管理器 [英] Persist Security Info && Table Adapter Manager

查看:111
本文介绍了坚持安全信息&&表适配器管理器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

表适配器管理器处理其所有连接的表适配器对象。
在更新之前,它会比较所有TAO连接字符串,以确保它们全部等于。 (请参阅此处我之前关于此的主题)
如果主连接字符串的属性Persist Security Info设置为FALSE,当您使用单个表适配器(即填充方法)向数据集表发送命令时,将重置连接字符串并且密码被隐藏(切除)。

然后,如果您想通过TableAdapterManager.UpdateAll()方法更新数据集,此连接字符串更改可能会导致异常升级:
"由TableAdapterManager管理的所有TableAdapter必须使用相同的连接字符串。"

如何在不将Persist Security Info设置为TRUE的情况下避免这种情况,从而创建安全层中的一个洞?


-------
生活是在做其他项目时发生的事情
-------

A Table Adapter Manager handles all its connected Table Adapter Object.
Before updating, it compares all its TAO Connection strings to be sure they're all equals. (See here my previous thread about this)

If the main connection string has the property Persist Security Info set to FALSE, when you send a command to a dataset table with a single table adapter (i.e. Fill method) the connection string is reset and the password is hidden (cut away).

But, then, if you want to update the dataset by a TableAdapterManager.UpdateAll() method, this connection string changes can cause an exception to be risen:
"All TableAdapters managed by a TableAdapterManager must use the same connection string."

How can I avoid this, without setting Persist Security Info to TRUE and so creating a hole in the security layer?


------- Life is what happens while doing other projects -------

推荐答案



使用Windows Authenti强烈建议使用cation,因为用户凭据未在连接字符串中公开。如果无法使用Windows身份验证连接到数据库,请考虑使用SqlConnectionStringBuilder在运行时创建连接字符串。

有关详细信息,请参阅此处:
http://msdn.microsoft.com/en-us/library/ms254947(VS.80).aspx
http: //msdn.microsoft.com/en-us/library/ms254978(VS.80).aspx

谢谢,
李静
Hi,

Using Windows Authentication is highly recommended because user credentials are not exposed in the connection string. If you cannot use Windows Authentication to connect to database, then consider creating connection strings at run time using the SqlConnectionStringBuilder.

For more information, please see here:
http://msdn.microsoft.com/en-us/library/ms254947(VS.80).aspx
http://msdn.microsoft.com/en-us/library/ms254978(VS.80).aspx

Thanks,
Jing Li


这篇关于坚持安全信息&&表适配器管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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