我有以下连接字符串
<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"/>
我的问题是,我不能在提供程序连接字符串密码中使用引号。 我试图根据堆栈溢出和MladenPrajdić博客上的几篇文章转义密码:https://weblogs.sqlteam.com/mladenp/2008/10/21/different-ways-how-to-escape-an-xml-string-in-c/
我试图用',',System.Security.SecurityElement.Escape,XMLWriter,System.Security.SecurityElement.Escape和System.Web.HttpUtility.HtmlEncode()来对诸如'hello'World'这样的密码进行转义。 。
我想问题出在以下事实:我在连接字符串中有一个封装的字符串(提供者连接字符串)。
有什么想法吗?
非常感谢您!