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


B

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
 
Ad

Advertisements

P

Phil H

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top