SQL Server Compact 3.5 and 4.0 Toolbox add-in for Visual Studio. This add-in adds several features to help your SQL Server Compact development efforts: Scripting of tables and data, import from SQL Server and CSV files and much more.
Very useful tool. Great for someone who is not particularly experienced with SQL DB management / editing. Clean and familiar (VS2010 icons) browsing with a no frills SQL editor with auto-generated queries. The only thing I use the standard Server Explorer for now is Table creation.
After creating a DataContext for Linq to SQL (sqlce 3.5, VS 2010, W7, toolbox 18.104.22.168), I find that I need to use the project name preceeding the datacontext name to instantiate the local datacontext like this:
Dim DCLocal As New PSILibrary.PSLocalDataContext(SV.ConnectionStringLocal)
... where PSILibrary is a project that is subordinate to the main project in this solution. The .sdf file and the PSLocalDataContext file are contained in the PSILibrary project.
The first time I created the datacontext file I didn't need to do this. But subsequent changes now require it.
All seems to work well, but it doesn't seem correct to require that the project name has to preceed the PSLocalDataContext name.
I did try 'Imports PSILibrary' but that made no difference.
Is something wrong or is this correct?
Thanks for your reply.
After a night's sleep I figured this out. When the Toolbox creates the DataContext, a Namespace is automatically created for the entire DataContext - which is the same name as the Project!
I removed that Namespace from the DataContext, and that solves the problem.
I have installed this tool and tried to export database to localdb/Express and i m receiving msg that "Database Exported" but when i check localDB, i m not getting single table over there and that localDB will be blank just like when you create new one. What should i do?
I have your toolbox and SQL Compact 4.0 Installed but when I try to "Create LINQ to SQL Data Classes" from the SQL Server Compact for runtime 4.0, I get this error box:
"System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlServerCE, Version=22.214.171.124 ...
If I install SQL Compact 3.5 I can generate the classes but then when I use the Data Context it crashes since it is using a 4.0 database with LINQ classes for 3.5. HELP !
This tool is great, I love the Visual Studio add-in.
Is there a way to programatically convert a v3.5 database into a v4, and back again? Windows Devices only support CE 3.5, but I can only use v4 to create the database.
Your tool was cool, and was able to import my images to a table.
Now I am in the need of reading these images and display it to a set of controls. Upto this point I am not sure how to convert the SQl.Data.Linq.Binary (which the DB gives me in the LINQ query) to a System.Windows.Controls.Media.Image type. But before that I need to get my DB connection successful.
I have seen many of your tutorials and specially this one:
and followed the steps in creating the datacontext class, for my DB.
But just when I wanted to use this class, I was getting a NotSupportedException when I try to use the generated connection string. This is how I instantiate the generated datacontext class:
EasyFoodMobDBContext dbcontext = new EasyFoodMobDBContext(EasyFoodMobDBContext.ConnectionString);
and the static string variable "ConnectionString" in the generated datacontext looks like:
public static string ConnectionString = "Data Source=isostore:/EasyFoodMobDB#1.sdf";
and when run it throws an exception at the constructor 1st line:
public EasyFoodMobDBContext(string connectionString) : base(connectionString)
The excpetion details:
NotSupportedException was unhandled. Data Source=\Applications\Data\D9B6B61C-7FDF-4354-8B72-1638291A52EF\Data\IsolatedStore\EasyFoodMobDB
What could I be missing or doing wrong?