Orchard/lib/sqlce/ReadmeSSCE_ENU.htm

532 lines
28 KiB
HTML
Raw Normal View History

<html xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:msxsl="urn:schemas-microsoft-com:xslt"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" /><META NAME="save" CONTENT="history" /><title>Readme for Microsoft SQL Server Compact 4.0</title><style TYPE="text/css">
body
{
background: #FFFFFF;
color: #000000;
font-family: Verdana;
font-size: medium;
font-style: normal;
font-weight: normal;
margin-top: 0;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
width: 100%;
}
div.#mainSection
{
font-size: 70%;
width: 100%;
padding-left: 10;
margin-right: 10;
}
div.#mainBody
{
font-size: 90%;
margin-top: 10;
padding-bottom: 20;
}
div.#header
{
background-color: #D2D2D2;
padding-top: 0;
padding-bottom: 0;
padding-left: 10;
padding-right: 0;
width: 100%;
}
div.#header table
{
border-bottom-color: #C8CDDE;
border-bottom-style: solid;
border-bottom-width: 1;
width: 100%;
}
span.#runningHeaderText
{
color: #003399;
font-size: 90%;
}
span.#nsrTitle
{
/* color: #003399;*/
font-size: 120%;
font-weight: 600;
}
div.#header table td
{
color: #000000;
font-size: 70%;
margin-top: 0;
margin-bottom: 0;
padding-right: 20;
}
div.#header table tr.#headerTableRow3 td
{
padding-bottom: 2;
padding-top: 5;
}
div.#header table.#bottomTable
{
border-top-color: #FFFFFF;
border-top-style: solid;
border-top-width: 1;
text-align: left;
}
div.#footer
{
font-size: 90%;
margin-top: 0;
margin-bottom: 0;
margin-left: -5;
margin-right: 0;
padding-top: 2;
padding-bottom: 2;
padding-left: 0;
padding-right: 0;
width: 100%;
}
hr.#footerHR
{
border-bottom-color: #EEEEFF;
border-bottom-style: solid;
border-bottom-width: 1;
border-top-color: C8CDDE;
border-top-style: solid;
border-top-width: 1;
height: 3;
color: #D2D2D2;
}
div.section
{
padding-top: 2;
padding-bottom: 2;
padding-right: 15;
width: 100%;
}
.heading
{
color: #000000;
font-weight: bold;
margin-top: 18;
margin-bottom: 8;
}
h1.heading
{
color: #000000;
font-size: 150%;
}
.subHeading
{
color: #000000;
font-weight: bold;
font-size: 150%;
margin-bottom: 4;
}
h2.subHeading
{
color: #000000;
font-weight: bold;
font-size: 130%;
}
h3.subHeading
{
color: #000000;
font-size: 125%;
font-weight: bold;
}
h4.subHeading
{
color: #000000;
font-size: 110%;
font-weight: bold;
}
h4.procedureHeading
{
color: #000080;
font-size: 110%;
font-weight: bold;
}
h5.subHeading
{
color: #000000;
font-size: 100%;
font-weight: bold;
}
img
{
padding-bottom: 10;
}
img.toggle
{
border: 0;
margin-right: 5;
padding-bottom: 10;
}
img.copyCodeImage
{
border: 0;
margin: 1;
margin-right: 3;
padding-bottom: 10;
}
img.downloadCodeImage
{
border: 0;
margin-right: 3;
padding-bottom: 10;
}
img.viewCodeImage
{
border: 0;
margin-right: 3;
padding-bottom: 10;
}
img.note
{
border: 0;
margin-right: 3;
padding-bottom: 10;
}
img.#membersOptionsFilterImage
{
border: 0;
margin-left: 10;
vertical-align: middle;
padding-bottom: 10;
}
img.#toggleAllImage
{
margin-left: 4;
vertical-align: middle;
padding-bottom: 10;
}
div.#mainSection table
{
border: 0;
font-size: 100%;
width: 100%;
margin-top: 5px;
margin-bottom: 15px;
}
div.#mainSection table tr
{
vertical-align: top;
}
div.#mainSection table th
{
text-align: left;
background: #D8D8D8;
border-bottom-color: #D8D8D8;
border-bottom-style: solid;
border-bottom-width: 1;
color: #000000;
padding-left: 5;
padding-right: 5;
}
div.#mainSection table td
{
background: #F2F2F2;
border-top-color: #D8D8D8;
border-top-style: solid;
border-top-width: 1;
padding-left: 5;
padding-right: 5;
}
div.#mainSection table td.imageCell
{
white-space: nowrap;
}
div.code
{
width: 98%;
}
div.code table
{
border: 0;
font-size: 95%;
margin-bottom: 5;
width: 100%
}
div.code table th
{
text-align: left;
background: #D8D8D8;
border-bottom-color: #D8D8D8;
border-bottom-style: solid;
border-bottom-width: 1;
color: #000000;
font-weight: bold;
padding-left: 5;
padding-right: 5;
}
div.code table td
{
background: #CCCCCC;
border-top-color: #D8D8D8;
border-top-style: solid;
border-top-width: 1;
padding-left: 5;
padding-right: 5;
padding-top: 5;
}
div.alert
{
margin-left: 10;
width: 98%;
}
div.alert table
{
border: 1;
font-size: 100%;
width: 100%;
border: solid 1 #DEDFEF;
}
div.alert table th
{
text-align: left;
background: #D8D8D8;
border-bottom-width: 0;
color: #000000;
padding-left: 5;
padding-right: 5;
border: solid 1 #DEDFEF;
}
div.alert table td
{
background: #FFFFFF;
border-top-color: #D8D8D8;
border-top-style: solid;
border-top-width: 1;
padding-left: 5;
padding-right: 5;
border: solid 1 #DEDFEF;
}
span.copyCode
{
color: #0000ff;
font-size: 90%;
font-weight: normal;
cursor: hand;
float: right;
display: inline;
text-align: right;
}
.downloadCode
{
color: #0000ff;
font-size: 90%;
font-weight: normal;
cursor: hand;
}
.viewCode
{
color: #0000ff;
font-size: 90%;
font-weight: normal;
cursor: hand;
}
div.code pre
{
font-family: Monospace, Courier New, Courier;
font-size: 105%;
color: #000000;
}
code
{
font-family: Monospace, Courier New, Courier;
font-size: 105%;
color: #000000;
}
dl
{
margin-top: 0;
padding-left: 1;
}
dd
{
margin-bottom: 0;
margin-left: 0;
padding-left: 20;
}
dd p
{
margin-top: 5;
}
ul
{
margin-left: 17;
list-style-type: disc;
}
ul ul
{
margin-bottom: 4;
margin-left: 17;
margin-top: 3;
list-style-type: disc;
}
ol
{
margin-left: 24;
list-style-type: decimal;
}
ol ol
{
margin-left: 24;
margin-top: 3;
list-style-type: lower-alpha;
}
li
{
margin-top: 0;
margin-bottom: 0;
padding-bottom: 0;
padding-top: 0;
margin-left: 5;
}
li p
{
margin-top: 0;
margin-bottom: 0;
}
p
{
margin-bottom: 15;
}
.tip
{
color: #0000FF;
font-style: italic;
cursor:hand;
text-decoration:underline;
}
.math
{
font-family: Times New Roman;
font-size: 125%
}
.sourceCodeList
{
font-family: Verdana;
font-size: 90%;
}
pre.viewCode
{
width: 100%;
overflow: auto;
}
li:hover table, li.over table
{
background-color: #C0C0C0;
}
li:hover ul, li.over ul
{
background-color: #d2d2d2;
border: 1px solid #000;
display: block;
}
</style></head><body><div id="header"><table id="bottomTable" cellpadding="0" cellspacing="0"><tr><td align="left"><span id="nsrTitle">Readme for Microsoft SQL Server Compact 4.0</span></td></tr></table></div><div id="mainSection"><div id="mainBody"><p>11/06/2010 17:55:22</p><div class="introduction"><p>The most up-to-date version of this file is available online at the <a href="http://go.microsoft.com/fwlink/?LinkId=204986">Microsoft Download Center</a></p><p>The SQL Server documentation team welcomes your <a href="mailto:sqldocfb@microsoft.com?subject=SQL%20Server%20Compact%204.0%20readme%20file(\1:SQL\2:3.5.5386.0\3:SSC_RTW\4:readme_ssc\5:ReadmeSSC35.htm\6:\7:h\8:en-us\9:2007)&amp;body=---Please%20type%20comments%20here,%20leaving%20the%20subject%20line%20in%20place.---">documentation feedback</a>. We view and investigate all documentation issues but do not answer technical support questions here. For help with technical issues not related to documentation, see <a href="http://go.microsoft.com/fwlink/?LinkId=204987">Getting Assistance with SQL Server Compact</a>. If it is possible, submit feedback to us in English.</p></div><a name="BKMK_Contents" /><h1 class="heading">Contents</h1><div id="sectionSection0" class="section" name="collapseableSection" style=""><p><span sdata="link"><a href="#BKMK_1.0Introduction">1.0 Introduction</a></span></p><p><span sdata="link"><a href="#BKMK_1.1ObtainingSQLServerCompact4.0">1.1 Obtaining SQL Server Compact 4.0</a></span></p><p><span sdata="link"><a href="#BKMK_1.2SQLServerCompact4.0BooksOnline">1.2 SQL Server Compact 4.0 Books Online</a></span></p><p><span sdata="link"><a href="#BKMK_2.0SupportedOperatingSystemsandPlatformsforSQLServerCompact4.0">2.0 Supported Operating Systems and Platforms for SQL Server Compact 4.0</a></span></p><p><span sdata="link"><a href="#BKMK_3.0KnownIssues">3.0 Known Issues</a></span></p><p><span sdata="link"><a href="#BKMK_4.0AdditionalInformation">4.0 Additional Information</a></span></p><p><span sdata="link"><a href="#BKMK_4.1GettingSQLServerCompactAssistance">4.1 Getting SQL Server Compact Assistance</a></span></p><p><span sdata="link"><a href="#BKMK_4.2ProvidingFeedbackonSQLServerCompact">4.2 Providing Feedback on SQL Server Compact</a></span></p><p>[Return to <span sdata="link"><a href="#BKMK_Contents">Contents</a></span>]</p></div><a name="BKMK_1.0Introduction" /><h1 class="heading">1.0 Introduction</h1><div id="sectionSection1" class="section" name="collapseableSection" style=""><p>Microsoft® SQL Server™ Compact 4.0 is a small footprint, in-process database engine that allows developers to build robust applications for Windows desktop computers and for starter ASP.NET websites.</p><a name="BKMK_1.1ObtainingSQLServerCompact4.0" /><h3 class="subHeading">1.1 Obtaining SQL Server Compact 4.0</h3><div class="subsection"><p>SQL Server Compact 4.0 is available from the following Web download:</p><ul><li><p><a href="http://go.microsoft.com/fwlink/?LinkId=204988">SQL Server Compact 4.0</a></p></li></ul><div class="alert"><table width="100%" cellspacing="0" cellpadding="0"><tr><th align="left"><b>Important</b></th></tr><tr><td><p>The installation behavior of SQL Server Compact 4.0 on 32-bit and 64-bit operating systems has changed as compared to the previous versions of SQL Server Compact. The installation of SQL Server Compact 4.0 on 32-bit and 64-bit operating systems is as given below:</p></td></tr></table></div><div class="caption" /><div class="tableSection"><table width="50%" cellspacing="2" cellpadding="5" frame="lhs"><tr><td><p>Version</p></td><td><p>Operating system</p></td><td><p>Result</p></td></tr><tr><td><p>32-bit, SQL Server Compact 4.0 </p></td><td><p>32-bit</p></td><td><p>Successful</p></td></tr><tr><td><p>64-bit, SQL Server Compact 4.0 </p></td><td><p>64-bit</p></td><td><p>Successful</p></td></tr><tr><td><p>32-bit, SQL Server Compact 4.0 </p></td><td><p>64-bit</p></td><td><p>Error</p></td></tr><tr><td><p>64-bit, SQL Server Compact 4.0 </p></td><td><p>32-bit</p></td><td><p>Error</p></td></tr></table></div><p>[Return to <span sdata="l
engine.CreateDatabase();</pre></td></tr></table></span></div><p>Visual Basic:</p><div class="code"><span codeLanguage="other"><table width="100%" cellspacing="0" cellpadding="0"><tr><th> </th></tr><tr><td colspan="2"><pre>Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;encryption mode=platform default;Password=&lt;enterStrongPasswordHere&gt;;")
engine.CreateDatabase()</pre></td></tr></table></span></div></li><li><p>To change the encryption mode of an existing SQL Server Compact 4.0 database:</p><p>C#:</p><div class="code"><span codeLanguage="other"><table width="100%" cellspacing="0" cellpadding="0"><tr><th> </th></tr><tr><td colspan="2"><pre>SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf;Password=&lt;enterStrongPasswordHere&gt;;");
engine.Compact("Data Source=Northwind.sdf;encryption mode= enginedefault;Password=&lt;enterStrongPasswordHere&gt;;");</pre></td></tr></table></span></div><p>Visual Basic:</p><div class="code"><span codeLanguage="other"><table width="100%" cellspacing="0" cellpadding="0"><tr><th> </th></tr><tr><td colspan="2"><pre>Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;Password=&lt;enterStrongPasswordHere&gt;;")
engine.Compact("Data Source=Northwind.sdf;encryption mode= engine default;Password=&lt;enterStrongPasswordHere&gt;;")</pre></td></tr></table></span></div></li><li><p>To encrypt an unencrypted SQL Server Compact 4.0 database:
</p><p>C#:</p><div class="code"><span codeLanguage="other"><table width="100%" cellspacing="0" cellpadding="0"><tr><th> </th></tr><tr><td colspan="2"><pre>SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf");
engine.Compact("Data Source=Northwind.sdf;encryption mode=platform default;Password=&lt;enterStrongPasswordHere&gt;;");</pre></td></tr></table></span></div><p>Visual Basic:</p><div class="code"><span codeLanguage="other"><table width="100%" cellspacing="0" cellpadding="0"><tr><th> </th></tr><tr><td colspan="2"><pre>Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;")
engine.Compact("Data Source=Northwind.sdf;encryption mode=platform default;Password=&lt;enterStrongPasswordHere&gt;;"</pre></td></tr></table></span></div></li></ul></div><h3 class="subHeading">3.4</h3><div class="subsection"><p>SQL Server Compact 4.0 data types for parameters like <span class="parameter" sdata="paramReference">SqlDbType</span> or <span class="parameter" sdata="paramReference">DbType</span> should be explicitly set.
</p><p>If the data types for parameters such as <span class="parameter" sdata="paramReference">SqlDbType</span> or <span class="parameter" sdata="paramReference">DbType</span> are not explicitly set, an exception is be thrown. To resolve this issue, explicitly set the data type for parameters such as <span class="parameter" sdata="paramReference">SqlDbType</span> or <span class="parameter" sdata="paramReference">DbType</span>. This is critical in the case of BLOB data types (image and ntext). A code example is given below:</p><p>C#:</p><div class="code"><span codeLanguage="other"><table width="100%" cellspacing="0" cellpadding="0"><tr><th> </th></tr><tr><td colspan="2"><pre>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(128), 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);
paramName.Value = "Name1";
paramBlob.Value = "Name1".PadLeft(4001);
cmd.ExecuteNonQuery();</pre></td></tr></table></span></div><p>Visual Basic:</p><div class="code"><span codeLanguage="other"><table width="100%" cellspacing="0" cellpadding="0"><tr><th> </th></tr><tr><td colspan="2"><pre>Dim engine As SqlCeEngine = New SqlCeEngine(connString)
engine.CreateDatabase()
engine.Dispose()
Dim conn As SqlCeConnection = New SqlCeConnection(connString)
conn.Open()
Dim cmd As SqlCeCommand = conn.CreateCommand()
cmd.CommandText = "CREATE TABLE BlobTable(name nvarchar(128), blob ntext);"
cmd.ExecuteNonQuery()
cmd.CommandText = "INSERT INTO BlobTable(name, blob) VALUES (@name, @blob);"
Dim paramName As SqlCeParameter
Dim paramBlob As SqlCeParameter
paramName = cmd.Parameters.Add("name", SqlDbType.NVarChar, 128)
paramBlob = cmd.Parameters.Add("blob", SqlDbType.NText)
paramName.Value = "Name1"
paramBlob.Value = "Name1".PadLeft(4001)
cmd.ExecuteNonQuery()</pre></td></tr></table></span></div></div><h3 class="subHeading">3.5</h3><div class="subsection"><p>The SQL Server Compact 4.0 release does not support syncing of data with SQL Server using technologies like Microsoft Sync Framework, or merge replication, or remote data access (RDA).</p></div><h3 class="subHeading">3.6</h3><div class="subsection"><p>The generation of the Entity Data Model for SQL Server Compact will fail if there are duplicate constraint names in the SQL Server Compact schema.</p><p>In SQL Server Compact, the constraint names are unique within a table and this can allow duplicate constraint names in the database. The behavior is different from SQL Server, where the constraint names are unique across the database. If a SQL Server Compact schema has duplicate referential integrity (primary key foreign key relationship) constraint names, the generation of the Entity Data Model using the ADO.NET Entity Frameworks Entity Data Model Wizard will fail. The workaround is to change the name of the duplicate constraint name to be unique across the database, like by adding the name of the table to the constraint name.</p><p>[Return to <span sdata="link"><a href="#BKMK_Contents">Contents</a></span>]</p></div></div><a name="BKMK_4.0AdditionalInformation" /><h1 class="heading">4.0 Additional Information</h1><div id="sectionSection4" class="section" name="collapseableSection" style=""><p>This section describes how to obtain assistance and provide feedback about SQL Server Compact.</p><a name="BKMK_4.1GettingSQLServerCompactAssistance" /><h3 class="subHeading">4.1 Getting SQL Server Compact Assistance</h3><div class="subsection"><p>For more information, see the <a href="http://go.microsoft.com/fwlink/?LinkId=205142">SQL Server Compact Forum</a> and the <a href="http://go.microsoft.com/fwlink/?LinkId=205143">SQL Server Compact Team Blog</a>. </p></div><a name="BKMK_4.2ProvidingFeedbackonSQLServerCompact" /><h3 class="subHeading">4.2 Providing Feedback on SQL Server Compact</h3><div class="subsection"><p>To provide suggestions and bug reports about SQL Server Compact:</p><ul><li><p>Make suggestions and file bug reports about the features or the user interface of SQL Server Compact at the <a href="http://go.microsoft.com/fwlink/?LinkId=205144">MSDN product feedback Web site</a>.</p></li><li><p>Send suggestions or report inaccuracies in the documentation by using the feedback functionality in SQL Server Compact Books Online.</p></li></ul><p>[Return to <span sdata="link"><a href="#BKMK_Contents">Contents</a></span>]</p><p>© 2011 Microsoft Corporation. All rights reserved. </p></div></div></div><div id="footer" /></div></body></html>