3

I'm trying to create a new SqlCE 4.0 sdf database but I'm not sure which connection provider I need to use?

I downloaded CE4.0 from Microsoft separately. ... so is there a new provider we're suppose to use? Or do we use the 3.5 provider?

Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
  • Not sure, but I would suspect there is a new connection provider, given the incompatibility of many of the features between ver 3 and ver 4. – leppie Jan 20 '11 at 05:22

1 Answers1

4

A sample connection string would look like this:

<add name="integration" connectionString="Data Source=testdb.sdf" providerName="System.Data.SqlServerCe.4.0" />

You should also reference the System.Data.SqlServerCe.dll and the ADO.NET classes it provides.

NerdFury
  • 18,876
  • 5
  • 38
  • 41
  • What about in Visual Studio itself? When i goto the SERVER EXPLORER, there's only a 3.5 Provider. Is this because the 4.0 provider (for VS2010 UI) will be provided with VS2010 SP1 ? – Pure.Krome Jan 20 '11 at 06:27
  • ErikEJ has you covered. Sorry, I haven't used the visual tools. I've just been using it as a database for integration tests. – NerdFury Jan 20 '11 at 15:25