locked
Asp.net access the Data Access via WCF RRS feed

  • Question

  • User2067408771 posted

    Hi All,

    I have created an Asp.net application which access the Data Access Layer via WCF.

    From asp.net page I get values from DAL

     for example I get a Student entity and update some property values and then send that back to the DAL via Service

    In DAL I will call the SaveChanges.

    But the Values are getting updated nor inserted.

    Thursday, May 30, 2013 5:48 AM

Answers

  • User220959680 posted

    In DAL I will call the SaveChanges.

    But the Values are getting updated nor inserted.

    To create new record 

    entity.TableName.AddObject(objectBeingInserted);
    entity.SaveChanges();

    To update existing record

    entity.TableName.ApplyCurrentValues(recordBeingUpdated);
    entity.SaveChanges();

    Refer Using the Entity Framework in n-Tier ASP.NET Applications

    When the issue is still NOT resolved, post your source here for further help.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 30, 2013 10:09 AM

All replies

  • User220959680 posted

    In DAL I will call the SaveChanges.

    But the Values are getting updated nor inserted.

    To create new record 

    entity.TableName.AddObject(objectBeingInserted);
    entity.SaveChanges();

    To update existing record

    entity.TableName.ApplyCurrentValues(recordBeingUpdated);
    entity.SaveChanges();

    Refer Using the Entity Framework in n-Tier ASP.NET Applications

    When the issue is still NOT resolved, post your source here for further help.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 30, 2013 10:09 AM
  • User-193169305 posted

    Dear All,

    I have a similar requirement, like accesing my Bussiness Layer from UI through WCF and later the BL will access my DAL and so on. The application should be distributed application, so that, the UI and Class (Facade, BL and DAL) will be deployed in two different boxes.

    Can someone pls help in this regard? I am new to this type of architecture?

    Regards,

    Yashwanth

    Tuesday, June 4, 2013 10:31 AM