Freigeben über


Download available for SQL Server Compact 3.5 SP1 Beta for ADO.Net Entity Framework Beta 3

The SQL Server Compact 3.5 SP1 Beta for ADO.Net Entity Framework Beta 3 is available for download at Microsoft Download Center.

To install SQL Server Compact 3.5 SP1 Beta Release for ADO.NET Entity Framework Beta 3

  1. Install ADO.NET Entity Framework Beta 3 from Microsoft Download Center. You must ensure that the pre-requisites specified on the download page are installed before installing ADO.NET Entity Framework Beta 3.
  2. In Control Panel, double-click Add or Remove Programs. Uninstall SQL Server Compact 3.5 or SQL Server Compact 3.5 SP1 Beta.
  3. Install SQL Server Compact 3.5 SP1 Beta Release for the ADO.NET Entity Framework Beta 3 (SSCERuntime-ENU.msi) from the Microsoft Download Center. Note that administrator rights are required on a computer to install SQL Server Compact 3.5 SP1 Beta Release for ADO.NET Entity Framework Beta 3.

To install ADO.NET Entity Framework Tools December 07 Community Technology Preview (CTP)

  1. Install the ADO.NET Entity Framework Beta 3 and SQL Server Compact 3.5 SP1 Beta Release for the ADO.Net Entity Framework Beta 3 as specified above. Install ADO.NET Entity Framework Tools December 2007 CTP from the Microsoft Download Center. You must ensure that the pre-requisites specified on the download page are installed before installing ADO.NET Entity Framework Tools December 2007 CTP. The CTP installs on a Visual Studio 2008 installation.
  2. Copy the SQL Server Compact 3.5 SP1 Design Tools Beta (SSCEVSTools-ENU.exe) to your computer by clicking on Save or Save this program to disk and after the download is complete install SSCEVSTools-ENU.exe by double-clicking it. Do not install the SSCEVSTools-ENU.exe by clicking on the Run. While running the SSCEVSTools-ENU.exe file, Microsoft.SqlServerCe.Client.dll is extracted to %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE folder. The SSCEVSTools-ENU.exe will create a backup of the existing DLL at the location %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE.

For uninstalling SQL Server Compact 3.5 SP1 Beta refer to the read me.

The steps to create a sample application are as given below:

1. Start Visual Studio 2008 and create a console project by clicking on the menu item File à New à Project. In the New Project window expand Visual Basic or Visual C# , select Windows and then select Console Application. For the project the .Net Framework version should be .Net Framework 3.5. Name the project as SQLCompactEDMProject. On clicking OK the project is created

2. To generate the Entity Data Model for the Northwind.sdf, copy the Northwind.sdf from the folder %Program Files%\Microsoft SQL Server Compact Edition\v3.5\Samples to the users folder like C:\Users\<login name>\Documents\Visual Studio 2008\Projects\SQLCompactEDMProject\SQLCompactEDMProject. Select the SQLCompactEDMProject in the Solution Explorer and right-click, point to Add, and then click New Item. Select ADO.NET Entity Data Model in the Templates pane. Enter Northwind.edmx for the model name and click Add. The opening page of the Entity Data Model Wizard is displayed.

3. Select Generate from database in the Choose Model Contents dialog box and click Next. Click the New Connection button. The Connection Properties dialog box is displayed.

4. In the Connection Properties dialog click the button Change in the Data Source. In the Change Data Source dialog box select Microsoft SQL Server Compact 3.5 and click OK. Click the radio button My Computer in the Data Source. In the Connection Properties browse to the Northwind.sdf and click OK in the Connection Properties dialog. The Choose Your Data Connection screen in the Entity Data Model Wizard comes up.

5. The checkbox in front of Save entity connection settings in App.Config as: will be clicked by default. Change the name in the dialog from Entities to NorthwindEntities. Click Next to continue.

6. The Choose Your Database Objects dialog box is displayed. By default all the tables in the database are selected and will be included in the EDM. Uncheck the box next to Tables. This deselects all the tables in the database. Expand the Tables node and select the Customers, Orders, and Products tables. Change the Model Namespace: from Model to NorthwindModel

7. Click Finish to complete the wizard.

a. The wizard does the following:

b. Adds references to the System.Data, System.Data.Entity, System.Core, System.Security, and System.Runtime.Serialization assemblies.

c. Generates an .edmx file which encapsulates the information from the EDM mapping files.

d. Creates an App.Config file.

8. Double click the App.Config file in the Solution Explorer to open it. Change the provider entry from provider=Microsoft.SqlServerCe.Client.3.5 to provider=System.Data.SqlServerCe.3.5

9. Add an Imports (Visual Basic) or using (C#) statement at the beginning of the file to reference the EDM created from the Northwind database. (The name of the model corresponds to the value of the namespace attribute in your .edmx file).

Visual Basic

Imports SQLCompactEDMProject.NorthwindModel

C#

using NorthwindModel;

10. Add the following code to the Main subroutine (Module1.vb or Program.cs)

Visual Basic

Using db As NorthwindEntities = New NorthwindEntities

Dim customers = From c In db.Customers _

Where c.City = "London" _

Order By c.Company_Name Select c

For Each c As Customers In customers

Console.WriteLine(c.Company_Name)

Next

Console.ReadLine

End Using

C#

using (NorthwindEntities db = new NorthwindEntities())

{

var customers = from c in db.Customers

where c.City == "London"

orderby c.Company_Name

select c;

foreach (Customers c in customers)

{

Console.WriteLine(c.Company_Name);

}

Console.ReadLine ();

}

11. Press CTRL+F5 to run the application. After the results display on the console screen press enter to exit the application

For more information and samples please see the ADO.NET Entity Framework Beta 3 Documentation and ADO.NET Entity Framework Samples

Regards,

Ambrish Mishra

Program Manager - SQL Server Compact

Comments

  • Anonymous
    February 24, 2008
    Installed, but don't see the "ADO.NET Entity Data Model " in any template when I select new item. Like it is not there.

  • Anonymous
    February 26, 2008
    Quite a bit of activity last week in the Visual Studio and ORM spaces. Visual Studio released a CTP of

  • Anonymous
    March 26, 2008
    The comment has been removed

  • Anonymous
    March 27, 2008
    The entity framework supports the express editions of Visual Studio 2008.  However, the SQL Server Compact Design tools will not install with just the express editions.  Is that intentional?  Are the design tools required for local use of SQL Server Compact Edition?

  • Anonymous
    April 22, 2008
    I'm getting the same "Setup Error: Microsoft Visual Studio 2008 is not found" issue described in http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=333272 I have VS2008 on 64-bit Vista, fully patched.  I thought it might be a confilict with SQL Server Business Intelligence Development Studio that is installed as part of the SQL Server Management Studio for SQL 2005, but after removing it and Visual Studio 2005 Tools for Office Second Edition Runtime and Visual Studio 2005 Premier Partner Edition I'm still getting the error.  Any advice?

  • Anonymous
    April 22, 2008
    Hey Will,   We are working on this issue actively and we should update/refresh the release binaries soon which would work on 64-bit Thanks, Laxmi

  • Anonymous
    July 15, 2008
    This is a bit off topic but do you know if the newest version of SQL CE removes some of the limitations of the engine that meant it wasn't suitable for multi-threaded applications ? We have built an application based around Linq2SQL to provide data access, SQL CE 3.5 to run on client machines and Synchronization Framework to keep the local SQL CE databases up to date. We noticed random freezes that affect the UI thread (this is a WPF application) and we suspect that the SQL CE engine has a built in limitations with the quantity of threads accessing the database. PS: we do some data access on the UI thread, and on some others in the threadpool (the one that runs the synchronization process).

  • Anonymous
    July 15, 2008
    Daniel,  SQL CE has multi-threading support which you also seem to have used in your application.  Now, coming to the number of threads it would scale is a good question.  In our internal testing we have seen it doing good till 50 connections.  After that there is a dip in the curve.  However, I am not sure on if this information alone is enough for you to start with.   Can you please elaborate a bit more on random freeze as I am not able to get what you mean by random freeze, does it happen on huge query.  Did you check with single thread the same query?  Please contact us through 'Blog Contact' page on the top so that we can converse and dive into details. Thanks, Laxmi