Search code examples
c#databaseconnection-stringoledbsql-server-express

Make connection string ADO.NET


How can you make a connection string for an OleDbConnection? I have tried a lot of combinations and variants, but nothing works. I use a MS-SQL platform with C# to make the connection for SQL EXPRESS.

  1. Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Data\Northwind.mdb;User Id=admin;Password=;
  2. Data Source=(local);Provider=SQLOLEDB;Initial Catalog=FastCycle;Integrated Security=true
  3. Persist Security Info=False;Data Source=Northwind;Integrated Security=SSPI;Trusted_Connection=TRUE;providerName=System.Data.OleDb
  4. Provider=SQLOLEDB;Data Source=Northwind.mdb
  5. Provider=SQLEXPRESS;Data Source=Northwind.MDB

Solution

  • @paddy suggested me this site connectionstrings.com. It help me to find the correct string. It was:

    Provider=sqloledb;Data Source=.\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=SSPI;