1
votes

in VS2012, WPF project, after add connection string , got error

The type initializer for 'System.Windows.Application' threw an exception

The type initializer for 'System.Windows.Navigation.BaseUriHelper' threw an exception

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <connectionstrings>
      <add connectionstring="Data Source=x.x.x.x; User Id=sa;Password=abc; Initial Catalog=hello;" name="ConString"/>
    </connectionstrings>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
</configuration>
1

1 Answers

2
votes

connectionString with a capital S

The same with <connectionStrings>. Capital S

XML is case-sensitive.