Hi I get the following error. when I try to connect to the SQl Server. The keyword IntergratedSecrity isn't supported. What did I do wrong ?
here is my class and method method to create a connectionstring.
- using System.Configuration;
- using System.Data.SqlClient;
- namespace WindowsFormsApplication1.DataAccessLayer
- {
- class DatabaseLayer
- {
- public static SqlConnection OpenConnection()
- {
- var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["customers"].ConnectionString);
- connection.Open();
- return connection;
- }
- }
- }
and here is my ap.config
- "1.0" encoding="utf-8" ?>
-
-
-
"customers" connectionString="Data Source=\\MAC-CASPER\SQLSERVERCASPER; Initial Catalog=Customer_xxxxx; IntegratedSecurity=True" providerName="System.Data.SqlClient" />
Francis SusaimichaelPosted Apr 27, 2016, 3:41 PM