0

i'm working on project in Visual Studio's C# Windows Form Application project. I tried just simply typing:

System.Data.SqlServerCe

And the IDE keep telling that there is no Namespace named like that, so i googled it and majority of problems similar to mine was solved by including these libs by checking them in the "choose items", but in mine VS there is no records like that (look screen below)

Screenshot

I have installed, a ton of soft including SQL management studio 2008, SQL CE runtime 2008, and SQL CE runtime 2014.

David Pfeffer
  • 38,869
  • 30
  • 127
  • 202
Haito
  • 2,039
  • 1
  • 24
  • 35

1 Answers1

0

You need to add a reference to the Sql Server CE libraries.

You right click on your project reference

enter image description here

Choose Add Reference and select the Sql Server CE libraries you want to use (4.0 is the latest)

enter image description here

Steve
  • 213,761
  • 22
  • 232
  • 286
  • http://i.stack.imgur.com/hFbC8.png Sry for raw links but as far as i i'm concerned linking images is allowed from 10 reputation. – Haito Dec 08 '14 at 20:26
  • I just realised that i targeted wrong framework version, but after switched to 4, nothing changed. – Haito Dec 08 '14 at 20:29
  • OK that's explain the version numbers. But at this point something has not been installed correctly. Try to remove the install of Sql Server CE from your PC (Control Panel) and use the nuget console to add the libraries. – Steve Dec 08 '14 at 20:31
  • http://docs.nuget.org/ – Steve Dec 08 '14 at 20:58
  • 'Microsoft.SqlServer.Compact 4.0.8876.1' already installed. WindowsFormsApplication3 already has a reference to 'Microsoft.SqlServer.Compact 4.0.8876.1'. Still nothing .... I have reinstalled all the packages. – Haito Dec 08 '14 at 21:21
  • So if you look at the references folder you see the Microsoft SqlServer Compact listed (System.Data.SqlServerCe) – Steve Dec 08 '14 at 21:25
  • No, that's what i meant, the reference bar moved, but there's no System.Data.SqlServerCe... – Haito Dec 08 '14 at 21:26
  • Sorry, but at this point I have no more ideas. Try to build a simple console application and check if you can add the reference. If yes then there is something wrong just in your winformapp, otherwise something very strange happens with your Visual Studio. – Steve Dec 08 '14 at 21:31