Base solution for your next web application
Open Closed

EntityFrameworkCore Connection String #3959


User avatar
0
chehrhard created

Hi all

I've got a WPF application for prototyping. But since migration to v3.0 i've got an error at DB access

" ArgumentException: Format of the initialization string does not conform to specification starting at index 0."

Any Idea ? Here's the app.config sections used :

<connectionStrings>
    <add name="Default" connectionString="Server=*.*.*.*\sql_sauron; Database=K2Alpha; User id=sa ; password=****** ; MultipleActiveResultSets=true"  />
    
  </connectionStrings>

6 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    I'm not sure if wildcard connection strings are valid. Try localhost\sql_sauron. I also suggest you hide the password in the commented line (even if it's invalid).

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @aaron :), I have updated @ChEhrhard's password to *******.

  • User Avatar
    0
    chehrhard created

    hi, the wildcards are only here for hidding the real address. The real code has the right address and the connection works with the .host project (with the same string).

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ChEhrhard,

    Can you try to remove MultipleActiveResultSets=true from your connection string and see if it works ?

  • User Avatar
    0
    chehrhard created

    No luck ... same error.

    is there any setting to change after moving Entity6 to EntityCore ? Are the connection string the same ? Si the sql client the same ?

  • User Avatar
    0
    rvanwoezik created

    Try escaping backslash (by double backslash)

    "Server=...\sql_sauron; Database=K2Alpha; User id=sa ; password=****** ;"

    Hope this helps