locked
how do I databind from WCF to asp.net controls? RRS feed

  • Question

  • It is pretty easy to present a few WCF functions such as:
    MyCustomer GetCustomerById(int customerid);
    InsertNewCustomer(MyCustomer newcustomer);
    UpdateCustomer(MyCustomer customertoupdate);
    DeleteCustomer(MyCustomer customertodelete);
    My question is, how do I bind to asp.net controls in my code behind?
    btw, this is VS2008
    -Ethan Nelson 

    • Edited by Ethan Nelson Tuesday, May 3, 2011 6:07 PM confusion on what .net version
    Tuesday, May 3, 2011 5:12 PM

Answers

  • Found out the answer.

    ObjectDataSource is the control to use.  Create a business object class and mark it as "DataObject".  It will then appear in the configuration wizard for the objectdatasource control.

    You define the methods to use for select, update, insert and delete statements.

    Within these methods, you can make your WCF calls.

    -Ethan Nelson

    • Marked as answer by Ethan Nelson Saturday, June 25, 2011 10:01 PM
    Saturday, June 25, 2011 10:01 PM

All replies

  • On 5/3/2011 1:12 PM, Ethan Nelson wrote:
    > It is pretty easy to present a few WCF functions such as:
    > MyCustomer GetCustomerById(int customerid);
    > InsertNewCustomer(MyCustomer newcustomer);
    > UpdateCustomer(MyCustomer customertoupdate);
    > DeleteCustomer(MyCustomer customertodelete);
    > My question is, how do I bind to asp.net controls in my code behind?
    > -Ethan Nelson
     
    This is one way.
     
    http://www.codeproject.com/KB/aspnet/WCFRIA.aspx
     
    There are other ways, I am not going to go into detail here. You want to
    know how to do it and see solid code examples, then I suggest you get
    the DOFactory.
     
    http://www.dofactory.com/Framework/Framework
     
     
    Tuesday, May 3, 2011 5:28 PM
  • Found out the answer.

    ObjectDataSource is the control to use.  Create a business object class and mark it as "DataObject".  It will then appear in the configuration wizard for the objectdatasource control.

    You define the methods to use for select, update, insert and delete statements.

    Within these methods, you can make your WCF calls.

    -Ethan Nelson

    • Marked as answer by Ethan Nelson Saturday, June 25, 2011 10:01 PM
    Saturday, June 25, 2011 10:01 PM