none
I am working with Walkthrough: Creating an N-Tier Data Application using C# and I have 2 errors RRS feed

  • Question

  • I am working with Walkthrough: Creating an N-Tier Data Application using C# but at the end of it, the Visual studio is tell me 2 errors with the code proposed to Add the Form1_Load event handler.on presentation tier, the errors tell me a missing of reference to  'DataEntity tier.NORTHWNDDataSet.Customers.get'.
    Tuesday, November 6, 2012 3:24 PM

Answers

  • The event error can be correct doing the two steps below.

    6. Create a Form1_Load event handler by double-clicking an empty area of the form.

    7. Add the following code to the Form1_Load event handler.

    ServiceReference1.Service1Client DataSvc =
        new ServiceReference1.Service1Client();
    northwindDataSet.Customers.Merge(DataSvc.GetCustomers());
    northwindDataSet.Orders.Merge(DataSvc.GetOrders());

    -----------------------------------------------------------------------------------------------------------------------

    The 2nd error can be correct by performing the steps below.  Make sure you read the last two sentences about manually moving the class.

    Separating the TableAdapters from the Dataset

    After you create the dataset, separate the generated dataset class from the TableAdapters. You do this by setting the DataSet Project property to the name of the project in which to store the separated out dataset class.

    To separate the TableAdapters from the Dataset

    1. Double-click NorthwindDataSet.xsd in Solution Explorer to open the dataset in the Dataset Designer.

    2. Click an empty area on the designer.

    3. Locate the DataSet Project node in the Properties window.

    4. In the DataSet Project list, click DataEntityTier.

    5. On the Build menu, click Build Solution.

    The dataset and TableAdapters are separated into the two class library projects. The project that originally contained the whole dataset (DataAccessTier) now contains only the TableAdapters. The project designated in the DataSet Project property (DataEntityTier) contains the typed dataset: NorthwindDataSet.Dataset.Designer.vb (or NorthwindDataSet.Dataset.Designer.cs).

    Note Note

    When you separate datasets and TableAdapters (by setting the DataSet Project property), existing partial dataset classes in the project will not be moved automatically. Existing dataset partial classes must be manually moved to the dataset project.


    jdweng

    Tuesday, November 6, 2012 4:17 PM

All replies

  • The event error can be correct doing the two steps below.

    6. Create a Form1_Load event handler by double-clicking an empty area of the form.

    7. Add the following code to the Form1_Load event handler.

    ServiceReference1.Service1Client DataSvc =
        new ServiceReference1.Service1Client();
    northwindDataSet.Customers.Merge(DataSvc.GetCustomers());
    northwindDataSet.Orders.Merge(DataSvc.GetOrders());

    -----------------------------------------------------------------------------------------------------------------------

    The 2nd error can be correct by performing the steps below.  Make sure you read the last two sentences about manually moving the class.

    Separating the TableAdapters from the Dataset

    After you create the dataset, separate the generated dataset class from the TableAdapters. You do this by setting the DataSet Project property to the name of the project in which to store the separated out dataset class.

    To separate the TableAdapters from the Dataset

    1. Double-click NorthwindDataSet.xsd in Solution Explorer to open the dataset in the Dataset Designer.

    2. Click an empty area on the designer.

    3. Locate the DataSet Project node in the Properties window.

    4. In the DataSet Project list, click DataEntityTier.

    5. On the Build menu, click Build Solution.

    The dataset and TableAdapters are separated into the two class library projects. The project that originally contained the whole dataset (DataAccessTier) now contains only the TableAdapters. The project designated in the DataSet Project property (DataEntityTier) contains the typed dataset: NorthwindDataSet.Dataset.Designer.vb (or NorthwindDataSet.Dataset.Designer.cs).

    Note Note

    When you separate datasets and TableAdapters (by setting the DataSet Project property), existing partial dataset classes in the project will not be moved automatically. Existing dataset partial classes must be manually moved to the dataset project.


    jdweng

    Tuesday, November 6, 2012 4:17 PM
  • I got the same error, and I already did the above solution in the walkthrough. still have those errors...

    can anyone advise?

    Monday, January 8, 2018 4:59 PM