(1) Download SqlCe components
https://www.microsoft.com/en-us/download/details.aspx?id=17876
(2) Download VS2013 tool Designer
Https://marketplace.visualstudio.com/items?itemName=ErikEJ.SQLServerCompactSQLiteToolbox
(3) Create an empty text file with Notepad.
(4) Select "Server Explorer" in view to add the connection
(5) Select SQL Server Compace4.0
(6) Create an SDF file, for example, on C:\DB.SDF
(7) Double-click Database
(8) Right-click to create a new table.
(9) Connecting SqlCe
SqlCeEngine engine = new SqlCeEngine (connstring); engine. CreateDatabase (); engine. Dispose (); SqlCeConnection conn = new SqlCeConnection (connstring); Conn. Open (); SqlCeCommand cmd = conn. CreateCommand (); cmd.commandtext = "CREATE TABLE blobtable (name nvarchar (+), blob ntext);"; Cmd. ExecuteNonQuery (); cmd.commandtext = "INSERT into blobtable (name, blob) VALUES (@name, @blob);"; Sqlceparameter paramname = cmd. Parameters.Add ("name", SqlDbType.NVarChar, 128); Sqlceparameter Paramblob = cmd. Parameters.Add ("blob", sqldbtype.ntext);p aramname.value = "Name1";p aramblob.value = "Name1". PadLeft (4001);
Using the Microsoft SQL Server Compact Edition in Visual Studio 2013