473,388 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

What is the best way to make dual-way xml databinding?

I am looking for the best solution for this scenario:

ASP.NET needs display an editable form with 20 textboxes. Data source is
xml. Xml must be updated. if user clicks Update button on the form.

Scenario 1 - brute force

Load xml into XmlDocument,
txtName.Text = doc.SelectSingleNode ('\\bla\@bla").Value

private void OnNameChanged(object sender, System.EventArgs e)
{
doc.SelectSingleNode ("\\bla\@bla").Value = txtName.Text
}

Scenario 2 - databinind
Load DataSet from xml, hook up text box with dataset in txtName_Databinding
event I am not sure if it will work both ways.

Scenario 3 - Xml data island
I worked well in the past, not sure if it is still the best way to go..

I appreciate any opinions on that subject

-Stan
Nov 19 '05 #1
3 1193
I've not yet tried it myself, but have you considered using an XmlDataDocument?
Perhaps you can use the ObjectDataSource, build your own class that does
the Selects and Updates and then passback the XmlDataDocument as your storage
mechanism? If I had the time, it'd make for an interesting experiment.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I am looking for the best solution for this scenario:

ASP.NET needs display an editable form with 20 textboxes. Data source
is xml. Xml must be updated. if user clicks Update button on the form.

Scenario 1 - brute force

Load xml into XmlDocument,
txtName.Text = doc.SelectSingleNode ('\\bla\@bla").Value
private void OnNameChanged(object sender, System.EventArgs e)
{
doc.SelectSingleNode ("\\bla\@bla").Value = txtName.Text
}
Scenario 2 - databinind
Load DataSet from xml, hook up text box with dataset in
txtName_Databinding
event I am not sure if it will work both ways.
Scenario 3 - Xml data island
I worked well in the past, not sure if it is still the best way to
go..
I appreciate any opinions on that subject

-Stan


Nov 19 '05 #2
I cannot use XmlDataDocument because xml comes out of sql server directly
(FOR XML EXPLICIT) and there is no dataset (doc = new XmlDataDocument (ds))

ObjectDataSource is from NET 2.0 and I forgot to mention that this is in
1.1. Yes a lot of things will be simpler in 2.0, especially xml and object
databinding

One of the problem is that even with xml databinding I can bind control on
the server, but after postback this binding is lost, similar with DataGrid.
I guess there is no magic way to do that..

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:64**********************@msnews.microsoft.com ...
I've not yet tried it myself, but have you considered using an XmlDataDocument? Perhaps you can use the ObjectDataSource, build your own class that does
the Selects and Updates and then passback the XmlDataDocument as your storage mechanism? If I had the time, it'd make for an interesting experiment.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I am looking for the best solution for this scenario:

ASP.NET needs display an editable form with 20 textboxes. Data source
is xml. Xml must be updated. if user clicks Update button on the form.

Scenario 1 - brute force

Load xml into XmlDocument,
txtName.Text = doc.SelectSingleNode ('\\bla\@bla").Value
private void OnNameChanged(object sender, System.EventArgs e)
{
doc.SelectSingleNode ("\\bla\@bla").Value = txtName.Text
}
Scenario 2 - databinind
Load DataSet from xml, hook up text box with dataset in
txtName_Databinding
event I am not sure if it will work both ways.
Scenario 3 - Xml data island
I worked well in the past, not sure if it is still the best way to
go..
I appreciate any opinions on that subject

-Stan


Nov 19 '05 #3
Oh yeah... If you're in v1.1 then there's no two-way databinding at all.
You'll have to code it all manually. Sorry.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I cannot use XmlDataDocument because xml comes out of sql server
directly (FOR XML EXPLICIT) and there is no dataset (doc = new
XmlDataDocument (ds))

ObjectDataSource is from NET 2.0 and I forgot to mention that this is
in 1.1. Yes a lot of things will be simpler in 2.0, especially xml and
object databinding

One of the problem is that even with xml databinding I can bind
control on the server, but after postback this binding is lost,
similar with DataGrid. I guess there is no magic way to do that..

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:64**********************@msnews.microsoft.com ...
I've not yet tried it myself, but have you considered using an

XmlDataDocument?
Perhaps you can use the ObjectDataSource, build your own class that
does the Selects and Updates and then passback the XmlDataDocument as
your

storage
mechanism? If I had the time, it'd make for an interesting
experiment.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I am looking for the best solution for this scenario:

ASP.NET needs display an editable form with 20 textboxes. Data
source is xml. Xml must be updated. if user clicks Update button on
the form.

Scenario 1 - brute force

Load xml into XmlDocument,
txtName.Text = doc.SelectSingleNode ('\\bla\@bla").Value
private void OnNameChanged(object sender, System.EventArgs e)
{
doc.SelectSingleNode ("\\bla\@bla").Value = txtName.Text
}
Scenario 2 - databinind
Load DataSet from xml, hook up text box with dataset in
txtName_Databinding
event I am not sure if it will work both ways.
Scenario 3 - Xml data island
I worked well in the past, not sure if it is still the best way to
go..
I appreciate any opinions on that subject
-Stan


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Frank | last post by:
Hi, we are using oracle clients (Release 9.0.1.0.1 - Production) on an NT4 (Service Pack6) computers. the server is a W2K, (Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production With the...
5
by: John Dalberg | last post by:
I am planning to build a server to be used as a SQL Server and web server. Right now I can only use a single box for both. I have read some threads were dual processors are having problems with...
7
by: cwahlmeier | last post by:
Greetings, I am running DB2 Workgroup Edition on an Intel box with two physical CPUs. It is running Windows with hyperthreading. Thus, the operating system thinks it has 4 cpus. I am about to...
25
by: John Gibson | last post by:
Hi, all. I need to upgrade my dual Xeon PostgreSQL engine. Assuming similar memory and disk sub-systems, I am considering a Quad Xeon system vs. a Dual Itanium for PostgreSQL. I believe that...
1
by: Rocael Hernandez | last post by:
Hello all, I was wondering what's best for PG, since we have to decide what will be the new server for our DB, that will serve one or more websites. Our actual configuration is a dual xeon...
2
by: webwarrior | last post by:
Hi, Is there a reason why we have to pay more for licensing for a different kind of processor? Why are we not charged for the Hyperthreading on some processors also. If Oracle is really...
2
by: bruce_brodinsky | last post by:
Don't know whether to post this on a hardware or software board, so here goes: I wrote a c# chess program which searches for checkmate. Now, it's single-threaded. But I was thinking. I just got...
4
by: Rene | last post by:
Could someone please tell me if using one of the new dual-core CPUs will speed up the process of compiling a program using Visual Studio 2005? I have a solution that includes about 10 projects on...
4
by: LLessieux | last post by:
Hi, I have been seeing a strange behaviour when doing some tests on a Dual - Dual Core Opteron system using Windows XP (32bits with SP2). In out application we have a wrapper around the thread...
14
by: Mark S. | last post by:
Hello, I've written a high performance web app with C# and it completely relies on static hash tables (using sync) and classes. Under real world stress this app is handling 5 get requests per...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.