I am using VS2013 to connect to a .sdf database file and am getting this error:
The database file has been created by an earlier version of SQL Server Compact. Please upgrade using SqlCeEngine.Upgrade() method.
Here is my code:
string connectionstring = @"Data Source='E:\database.sdf'";
SqlCeConnection connection = new SqlCeConnection(connectionstring);
SqlCeCommand command = new SqlCeCommand("SELECT * FROM Colour", connection);
SqlCeDataAdapter dataAdapter = new SqlCeDataAdapter(command);
DataSet ds = new DataSet();
dataAdapter.Fill(ds);
I do not wish to upgrade the database (it is a production database). How can I retrive values from the database without upgrading the database?