双引号内的双引号

gof*_*net 4 c# asp.net string connection-string web-config

我正在将以下连接字符串写入web.config,但它给了我error.what正确的写入方式是什么?

<add name="stargaze_stargazeConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="D:\Work At DS\19th Jan\myastrolove.com_new\App_Data\dbName.mdf";Integrated Security=True;User Instance=True"/>
Run Code Online (Sandbox Code Playgroud)

Ode*_*ded 14

web.config是XML,因此您需要将内部引号转义为&quot;:

<add name="stargaze_stargazeConnectionString1" 
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=&quot;D:\Work At DS\19th Jan\myastrolove.com_new\App_Data\dbName.mdf&quot;;Integrated Security=True;User Instance=True"/>
Run Code Online (Sandbox Code Playgroud)