2

Are there any examples out there using Massive with SQL Server Compact 4.0?

I have seen many examples with SQL Express but not with CE.

I am having issues with my configuration (connection string / provider) and would like to see some examples.

Update:

I was able to get an example working with SQL Server 2008 but not Compact 4.0.

This is the Compact 4.0 connection string:

<add name="MassiveSpike"
     connectionString="Data Source=MassiveSpikeDb.sdf;"
     providerName="System.Data.SqlServerCe.4.0"
/> 

Any ideas?

Final Update

I tweaked the code in Massive to use a connection string provider if one is defined:

var _providerName = "System.Data.SqlClient";            
if(ConfigurationManager.ConnectionStrings[connectionStringName].ProviderName != null)
_providerName = ConfigurationManager.ConnectionStrings[connectionStringName].ProviderName;
Ken Burkhardt
  • 3,528
  • 6
  • 33
  • 45
  • For now I decided to use a similar library called Simple.Data as it works well with SQL Server Compact 4.0 - check it out here: https://github.com/markrendle/Simple.Data – Ken Burkhardt Nov 11 '11 at 16:59

1 Answers1

1

I used the standard Massive file, but I had to change the provider name on line 148 (about) to:

var _providerName = "System.Data.SqlServerCe.4.0";

After that everything worked.

Hans Olsson
  • 54,199
  • 15
  • 94
  • 116
Paul Mason
  • 26
  • 1
  • Instead of hardcoding the provider to SQLServerCe.4.0 I put in some logic to use the provider if one is defined in the connection string but keep the default to Sql Server like Rob had (see above). Thanks for the help! – Ken Burkhardt Dec 01 '11 at 14:02