Escape quote in web.config connection string

后端 未结 5 1736
梦谈多话
梦谈多话 2020-11-30 02:13

I have a connection string in my web config:



        
5条回答
  •  死守一世寂寞
    2020-11-30 02:43

    Odeds answer is almost complete. Just one thing to add.

    1. Escape xml special chars like Emanuele Greco said.
    2. Put the password in single quotes like Oded said
    3. (this one is new) Escape single ticks with another single tick (ref)

    having this password="'; this sould be a valid connection string:

    connectionString='Server=dbsrv;User ID=myDbUser;Password='"&&;'
    

提交回复
热议问题