Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Just for getting a grip (VS 2010):</p> <ol> <li>Create a console project</li> <li>Add a reference to System.Data.SqlServerCe (in Program Files\Microsoft SQL Server Compact Edition\v3.5\Desktop\System.Data.SqlServerCe.dll on my computer)</li> <li>Right click the project node in Solution Explorer, select "Add => New Item...", choose "Local Database", name it MyDB</li> <li>A new file MyDB.sdf will be added to the project (a MS SQL Server Compact Database)</li> <li>Right click the new file, click "Open", the database will be open in "Server Explorer"</li> <li>In "Server Explorer" expand MyDB.sdf, right click Tables, "Create Table" (name it MyTable)</li> <li>Add two columns "Field1" and "Field2" (leave them nvarchar(100) for now)</li> <li>Right click the new table, choose "Show Table Data", fill in your data</li> </ol> <p>The code:</p> <pre><code>using System.Data.SqlServerCe; namespace ConsoleApplication6 { class Program { static void Main(string[] args) { using (var cn = new SqlCeConnection("Data Source=MyDB.sdf")) { cn.Open(); using (var cmd = cn.CreateCommand()) { cmd.CommandText = "select * from MyTable where Field2 like '%AB%'"; using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { Console.WriteLine("Field1: {0}", reader[0]); } } } } Console.ReadKey(); } } } </code></pre> <p>Will output fox jumps the lazy.</p> <p><strong>BUT</strong>, I would go with <a href="http://www.sqlite.org/" rel="noreferrer">SQlite</a> for simple purposes. Wrapper is here: <a href="http://system.data.sqlite.org/index.html/doc/trunk/www/index.wiki" rel="noreferrer">http://system.data.sqlite.org/index.html/doc/trunk/www/index.wiki</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload