I was just playing with databases in C# 2010 Express and while typing ‘using System.Data.’ the auto-complete thing showed me the SqlServerCe in System.Data as an option. Not sure what I did but when I made a new application and added the line ‘using System.Data.SqlServerCe;’ I got a “SqlServerCe does not exist” error. I tried adding some references but still doesn’t work. Actually what I’ve been trying to do is to connect to SOME, ANY database but I still can’t. All samples I’ve found seem to assume something I don’t know. I’ve been trying to connect with SqlConnection by setting the ConnectionString to everything I can imagine, but I keep getting errors. I have installed SQL Server compact edition, and I think I also have SQL Server (normal edition?). Please I’m getting desperate! All I want is very, very simple. I want to have a data table, I don’t care about where or how I store it since the only program that will use it is my program, and be able to do SQL queries on it. Actually I don’t even need to save it after the program closes. I would just use a DataTable or even a 2d array if I could do SQL queries on them. Please if you can give me a sample would be great.
Share
If you get an error from using that using statement, then you need to add a reference to that assembly.
On my XP box, the location of that is:
Seeing you are using VS2010, just replace
3.5with4.0in the directory name.