Visual Studio 2008 (C #) with SQL Compact Edition Database Error: 26

A network or specific instance error occurred while creating a connection to SQL Server. The server was not found or was unavailable. Verify that the instance name is correct and that SQL Server is configured for a remote connection. (provider: SQL network Interfaces, error: 26 - Search error Specified server / instance)

I created a SQL compact database, included it in my application and can connect to the database differently from other database editors, but in my application I try

using (SqlConnection con = new SqlConnection(Properties.Settings.Default.DatabaseConnection))
{
    con.Open();
}

connection string

Data Source = | DataDirectory | \ Database.sdf

Am I at an impasse, any insight?

+3
2

. SqlConnection SQL-, SQL Server Compact.

connectionstrings.com . , SqlCeconnection

+5

SqlCeConnection SqlConnection, System.Data.SqlServerCe System.Data.SqlServer.

.

+1

Source: https://habr.com/ru/post/1729715/


All Articles