Home All Groups Group Topic Archive Search About

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

Author
24 Sep 2007 8:44 PM
Bill Nicholson
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

Author
26 Sep 2007 8:42 PM
Phil H
On 24 Sep, 21:44, Bill Nicholson <namewitheldbyrequ***@gmail.com>
wrote:
Show quote
> 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

AddThis Social Bookmark Button