我要用Visual Studio 2008 编辑一个关于SQL的程序 RRS feed

  • 问题


    我要用Visual Studio 2008 编辑一个关于SQL的程序,PocketPC_DataAccess ,可是一开始要加  System.Data.SqlClient.

    我使用的2005可以找到,但是老师必须要我用Visual Studio 2008 做,我电脑里有SQL2005,但是SQL2008 我不可以装,请问Visual Studio 2008 可以使用SQL2005吗?





    Lab 5: Interacting with SQL Server


    Summary:   In this lab you will learn how to:



    ·                 Connect to and retrieve information from a SQL Server database. 

    ·                 You will also see how to utilize a dataset to persist information onto the device


    Creating a Smart Device Project and Adding References



    In this lab you’ll see how you can directly interact and retrieve data from a SQL Database.

    1.      Navigate to Start | Programs | Microsoft Visual Studio 2008 | Microsoft Visual Studio 2008.


    2.      Click New Project.


    3.      In the New Project dialog, in Project Types, click Visual Basic->Smart Device.


    4.      In Templates, click Smart Device Project. In the Name field type “PocketPC_DataAccess”.


    5.      In Target platform, select Pocket PC 2003

          ->Device Application.


    6.      In the Add New Smart Device Project dialog, select Pocket PC 2003 and .NET Compact Framework Version 3.5. Choose the Templates as Device Application. Click OK.

    To create a PocketPC application with SDE that communicates with a SQL Database you need to add a few references.

    7.      In the Solution Explorer, right-click References and select Add Reference.

    When you add the System.Data reference, you have access to objects such as the DataSet.

    8.      In the Add Reference dialog, select System.Data.

    The Dataset requires a reference to System.XML.

    9.      Press Ctrl and select System.XML.


    Next you’ll need to add a reference to the System.Data.SqlClient assembly.

    10.  Select System.Data.SqlClient.

    Both assemblies should be in the list of Selected Components at the bottom.

    Once those steps are done you’ll go onto building the user interface and adding the code that connects to and retrieves information from the database.

    11. Click OK.

    2008年4月28日 2:42