Error In Connection To Database
The following code gives an error during execution. string connectionString = 'Data Source=D:\\Base.sdf;Persist Security Info=False'; SqlConnection sqlConnection = new SqlConnectio
Solution 1:
Your database is a Sql Server compact edition one, you must use :
SqlCeConnectionsqlConnection=newSqlCeConnection(connectionString);
Download the libs from here Microsoft SQL Server Compact 4.0
- Add a reference to
System.Data.SqlServerCe.dllto your project - Add this using directive using
System.Data.SqlServerCe; - Use
SqlCeConnectioninstead ofSqlConnection
Post a Comment for "Error In Connection To Database"