Is there a way to do 2-way binding with .Net XmlDataSource Controls?

Discussion in 'ASP .Net Web Controls' started by Bill Nicholson, Sep 24, 2007.

  1. Is there a way to do 2-way binding with .Net XmlDataSource Controls?
    It looks like only one-way binding is possible. I have that working,
    hooked to a GridView control and that works well. I can also extract
    the rows from the GridView control programatically. Can revise the
    rows and write them back to the XML file using the XmlDataSource
    control? Or, do I have to use the XMLReader and XMLWriter classes?

    Does anyone have a good example of how to create an ASP .Net UI to
    read/edit/write XML files?

    Thanks,

    Bill
    Cincinnati, OH USA
    Bill Nicholson, Sep 24, 2007
    #1
    1. Advertising

  2. Bill Nicholson

    Phil H Guest

    On 24 Sep, 21:44, Bill Nicholson <>
    wrote:
    > Is there a way to do 2-way binding with .Net XmlDataSource Controls?
    > It looks like only one-way binding is possible. I have that working,
    > hooked to a GridView control and that works well. I can also extract
    > the rows from the GridView control programatically. Can revise the
    > rows and write them back to the XML file using the XmlDataSource
    > control? Or, do I have to use the XMLReader and XMLWriter classes?
    >
    > Does anyone have a good example of how to create an ASP .Net UI to
    > read/edit/write XML files?
    >
    > Thanks,
    >
    > Bill
    > Cincinnati, OH USA


    Hi Bill

    I have used XML data files in projects that do writing as well as
    reading too. However the XMLDataSource control won't cut it. You need
    to use an ObjectDatasource and put all the XML handling routines in a
    code module (class file) stored in the App_Code directory. You can
    then write select, update, insert, delete methods and link them the
    ObjectDatasource (using the Configure Datasource wizard).

    The reason for the lack of support for write operations from
    XmlDataSource is because of limitations using XML as a read/write
    datasource in a shared data access environment (i.e. no support for
    record locking etc). There are circumstances when it's viable, e.g. if
    the XML data acts as a read-only source for ordinary users but might
    be updated and maintained by a single administrator using web based
    tools. Otherwise consider using SQL (or possibly Ms Access) instead.
    Remember SQL server 2005 Express is free.

    Phil H
    Phil H, Sep 26, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Sinclair

    ASP.Net 2 XMLDataSource

    Rob Sinclair, Feb 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    449
    Rob Sinclair
    Feb 17, 2005
  2. Kenneth Keeley

    XMLDataSource with a GridView

    Kenneth Keeley, Apr 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    787
    Kenneth Keeley
    Apr 29, 2005
  3. =?Utf-8?B?bWlrZQ==?=

    populate checkboxlist from XmlDataSource (ASP.net 2.0)

    =?Utf-8?B?bWlrZQ==?=, Aug 18, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    3,361
    =?Utf-8?B?bWlrZQ==?=
    Aug 18, 2005
  4. Charlie@CBFC
    Replies:
    0
    Views:
    708
    Charlie@CBFC
    Dec 14, 2006
  5. Miro
    Replies:
    2
    Views:
    437
Loading...

Share This Page