【发布时间】:2023-03-20 08:47:01
【问题描述】:
我有以下连接字符串
<add name="EntitiesContainer"
connectionString="metadata=...;provider=System.Data.SqlClient;
provider connection string="Data Source=server;Initial Catalog=dbXYZ;User
ID=userxyz;Password=<password>;MultipleActiveResultSets=True""
providerName="System.Data.EntityClient"/>
我的问题是,我不能在提供程序连接字符串密码中使用引号。 我尝试根据有关堆栈溢出和 Mladen Prajdić 博客的几篇帖子来转义密码:https://weblogs.sqlteam.com/mladenp/2008/10/21/different-ways-how-to-escape-an-xml-string-in-c/
我尝试使用“与 "e、System.Security.SecurityElement.Escape、XMLWriter、System.Security.SecurityElement.Escape 和 System.Web.HttpUtility.HtmlEncode() 来转义类似 'hello"World' 的密码.
我想问题在于,我在连接字符串中有一个封装的字符串(提供者连接字符串)。
有什么想法吗?
非常感谢!
【问题讨论】:
-
使用
&amp;quot;?
标签: c# asp.net-mvc connection-string