・C:\Program Files\Microsoft SQL Server Compact Edition\v3.5 にある以下のファイル。
sqlceca35.dll
sqlcecompact35.dll
sqlceer35JA.dll
sqlceme35.dll
sqlceoledb35.dll
sqlceqp35.dll
sqlcese35.dll
・C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Device 以下にもあります。
System.Data.SqlServerCe.dll
・C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Samples 以下にあります。
Northwind.sdf
using System;
using System.Data.SqlServerCe;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
using(SqlCeConnection _conn = new SqlCeConnection(@"Data Source = |DataDirectory|\Northwind.sdf"))
{
SqlCeCommand cmd = new SqlCeCommand();
cmd.Connection = _conn;
cmd.CommandText = "SELECT [Employee ID], [Last Name], [First Name], Photo FROM Employees";
_conn.Open();
using (SqlCeResultSet resultSet = cmd.ExecuteResultSet(ResultSetOptions.Scrollable | ResultSetOptions.Updatable))
{
while (resultSet.Read())
{
Console.WriteLine(resultSet["Last Name"]);
}
}
}
}
}
}
$ mcs /t:exe /r:System.Data.dll
/r:System.Data.SqlServerCe.dll Program.cs ./Properties/AssemblyInfo.cs
** (/usr/lib64/mono/1.0/mcs.exe:32149): WARNING **: The class
System.Data.Common.DbConnection could not be loaded, used in
System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969db8053d3322ac
Program.cs(10,19): error CS0246: The type or namespace name
`SqlCeConnection' could not be found. Are you missing a using
directive or an assembly reference?
** (/usr/lib64/mono/1.0/mcs.exe:32149): WARNING **: The class
System.Data.Common.DbCommand could not be loaded, used in System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac
Program.cs(12,17): error CS0246: The type or namespace name
`SqlCeCommand' could not be found. Are you missing a using directive
or an assembly reference?
** (/usr/lib64/mono/1.0/mcs.exe:32149): WARNING **: The class
System.Data.Common.DbDataReader could not be loaded, used in
System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969db8053d3322ac
Program.cs(17,17): error CS0246: The type or namespace name
`SqlCeResultSet' could not be found. Are you missing a using directive
or an assembly reference?
Compilation failed: 3 error(s), 0 warnings