asp.net mvc - unable to connect to sql server ce database -


i trying open sqlconnection ce (.sdf) database throws exception:

a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: sql network interfaces, error: 26 - error locating server/instance specified)

what did right-click app_data folder , create database there. copied connection string properties , placed in web.config. when try "test connection" succeeds.

other connection string, did not specify other attributes data source, provider name, etc.

tia!

to connect sql server compact database file, must use sqlceconnection class, not sqlconnection. add reference system.data.sqlserverce.dll ado.net provider dll file use sqlceconnection class


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -