Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i face this error when i create conection with local db of SQL server 2014,
i create c# winform application when i run my application it show me error message where i call the connection string that created in app.config file.

What I have tried:

my App.config fille is
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
   <connectionStrings>
     <add name="dbx"
            connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='|DataDirectory|\db\RetilShop_POS;Integrated Security=True"
            providerName="System.Data.SqlClient"/>
   </connectionStrings>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
    </startup>
</configuration>   
Posted
Updated 31-Jan-19 22:35pm

 
Share this answer
 
HTML
connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='|DataDirectory|\db\RetilShop_POS;Integrated Security=True"
providerName="System.Data.SqlClient"/>

You have mismatched single and double quotes in your text.
 
Share this answer
 
Comments
Fahid Zahoor 1-Feb-19 9:45am    
yes i understand now
Richard MacCutchan 1-Feb-19 10:02am    
Whenever you get an error referring to formatting you should inspect the relevant strings carefully first. It would save the time spent posting your question and waiting for a response.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900