Escape ;(semicolon) in odbc connection string in app.config file

后端 未结 5 1725
不思量自难忘°
不思量自难忘° 2020-12-06 05:43

I have created a windows form with certain fields. I am trying to interact with oracle database through ODBC DSN connections.

I have an issue in the below connection

5条回答
  •  我在风中等你
    2020-12-06 06:16

    I ran into a similar problem with an entity framework connection string. While I was not using an OdbcConnection I thought I would add what worked for me to help anyone with my issue that was similar. We had a password created with a semicolon in it. And it broke our entity framework connection string. The error was:

    'Keyword not supported: '[rest of password after semicolon];multipleactiveresultsets'.'

    I resolved the issue by placing single quotes (') around the username and password fields. The result was a connection string that contained the following:

    initial catalog=myDB;User     
    Id='MyUser';Password='abc;123';multipleactiveresultsets=True;
    

提交回复
热议问题