Using the Microsoft SQL Server Compact Edition in Visual Studio 2013

Source: Internet
Author: User
Tags compact

(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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.