473,396 Members | 2,093 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,396 software developers and data experts.

How to bind to XML??

Dan
Very newbie question here:

Any suggestions on how to bind an XML file to a combobox and datagrid? I've
had no problem reading the data in a datagrid. But the combobox is another
story.

I want to select an employees name in a combobox and then display details of
selected employee in a datagrid. So everytime a new employee was selected,
the datagrid would change accordingly. Any good ideas on how this is done?
Would that data be placed in one single xml file with nested elements, or do
I need multiple xml files(one for every employee)?

Thanks
Nov 17 '05 #1
7 2184
I want to do a similar thing using access database, textbox and list view.

Can anyone guide me and Dan.

Regards,
Rahul.

"Dan" wrote:
Very newbie question here:

Any suggestions on how to bind an XML file to a combobox and datagrid? I've
had no problem reading the data in a datagrid. But the combobox is another
story.

I want to select an employees name in a combobox and then display details of
selected employee in a datagrid. So everytime a new employee was selected,
the datagrid would change accordingly. Any good ideas on how this is done?
Would that data be placed in one single xml file with nested elements, or do
I need multiple xml files(one for every employee)?

Thanks

Nov 17 '05 #2
Ron
"Dan" <er****@ecenet.com> wrote in message
news:a-********************@trueband.net...
Very newbie question here:

Any suggestions on how to bind an XML file to a combobox and datagrid?
I've
had no problem reading the data in a datagrid. But the combobox is
another
story.

I want to select an employees name in a combobox and then display details
of
selected employee in a datagrid. So everytime a new employee was
selected,
the datagrid would change accordingly. Any good ideas on how this is
done?
Would that data be placed in one single xml file with nested elements, or
do
I need multiple xml files(one for every employee)?

Thanks


Hi Dan.
You can read the XML into a DataSet. Have a look at the VS/MSDN help.
Regards,
Ron.
Nov 17 '05 #3
Dan
Hi Ron,

I was able to read the xml file into a DataSet with no problem... the
problem comes when I try to list one element from the xml file in the
combobox, and then display the details (ie: remaining elements) in the
DataGrid.

I could also write an xml file for each employee. There's a little more than
100 employees that I'd need to describe data for so I don't know if that'd
be excessive or not. Oh well.
"Ron" <no***@nowhere.com> wrote in message
news:uz**************@tk2msftngp13.phx.gbl...
"Dan" <er****@ecenet.com> wrote in message
news:a-********************@trueband.net...
Very newbie question here:

Any suggestions on how to bind an XML file to a combobox and datagrid?
I've
had no problem reading the data in a datagrid. But the combobox is
another
story.

I want to select an employees name in a combobox and then display details of
selected employee in a datagrid. So everytime a new employee was
selected,
the datagrid would change accordingly. Any good ideas on how this is
done?
Would that data be placed in one single xml file with nested elements, or do
I need multiple xml files(one for every employee)?

Thanks


Hi Dan.
You can read the XML into a DataSet. Have a look at the VS/MSDN help.
Regards,
Ron.

Nov 17 '05 #4
Ron
"Dan" <Da*@DanTheMan.com> wrote in message
news:y8********************@trueband.net...
Hi Ron,

I was able to read the xml file into a DataSet with no problem... the
problem comes when I try to list one element from the xml file in the
combobox, and then display the details (ie: remaining elements) in the
DataGrid.

I could also write an xml file for each employee. There's a little more
than
100 employees that I'd need to describe data for so I don't know if that'd
be excessive or not. Oh well.

<snip>
Does the dataset contain one table for the employee data and another table
for the details? If it does, you can set a data relation between them, and
then bind the combobox to the employee table and the datagrid to the details
table. When you changed the selected index of the combobox, the datagrid
should change to show the new details. The help has good information on this
sort of thing.
Regards,
Ron.
Nov 17 '05 #5
Ron
"Ron" <no***@nowhere.com> wrote in message
news:ed**************@tk2msftngp13.phx.gbl...
Does the dataset contain one table for the employee data and another table
for the details? If it does, you can set a data relation between them, and
then bind the combobox to the employee table and the datagrid to the
details table. When you changed the selected index of the combobox, the
datagrid should change to show the new details. The help has good
information on this sort of thing.
Regards,
Ron.

What I should have written was bind the combobox to the employee table and
the datagrid to the data relation.
There is a walkthrough called Creating a Master-Detail Windows Form. That
example uses SQL Server and a listbox, not a combobox, but I am sure you can
adapt the idea to suit what you require.

Good Luck,
Ron.
Nov 17 '05 #6
Dan
Thanks, I'll take a look at that Master Detail tutorial. I also grabbed the
MSDE, if all else fails, maybe I could just "pack" my own db with the app.
"Ron" <no***@nowhere.com> wrote in message
news:e0**************@TK2MSFTNGP12.phx.gbl...
"Ron" <no***@nowhere.com> wrote in message
news:ed**************@tk2msftngp13.phx.gbl...
Does the dataset contain one table for the employee data and another table for the details? If it does, you can set a data relation between them, and then bind the combobox to the employee table and the datagrid to the
details table. When you changed the selected index of the combobox, the
datagrid should change to show the new details. The help has good
information on this sort of thing.
Regards,
Ron. What I should have written was bind the combobox to the employee table and
the datagrid to the data relation.
There is a walkthrough called Creating a Master-Detail Windows Form. That
example uses SQL Server and a listbox, not a combobox, but I am sure you

can adapt the idea to suit what you require.

Good Luck,
Ron.

Nov 17 '05 #7
Ron
"Dan" <Da*@DanTheMan.com> wrote in message
news:mb********************@trueband.net...
Thanks, I'll take a look at that Master Detail tutorial. I also grabbed
the
MSDE, if all else fails, maybe I could just "pack" my own db with the app.

<snip>
Ok Dan.
Well, good luck on the solution you finally decide on.
Regards,
Ron.
Nov 17 '05 #8

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

Similar topics

6
by: Clarence Gardner | last post by:
I've got a problem that I don't see how to program around. A socket server that was running fine, today started getting an exception from the bind() call (errno 22, Invalid argument) and yet the...
1
by: Achille Carette | last post by:
Hello all, I noticed a difference in the explain plans between JDBC using bind variables (PreparedStatement) and SQLPlus for the same query. The query made through JDBC using bind variables...
2
by: P G | last post by:
I hope this is on topic here. I have a problem compiling a simple example of the use of boost::bind. Please take a look at the program below. ...
4
by: Arturo Cuebas | last post by:
The program below contains a compile error. Following the program you will find the typical fix then my idea for a library that facilitates a more elegant fix. #include <boost\bind.hpp> using...
2
by: IndyStef | last post by:
I am trying to use boost's bind on a member function, on the VC8 compiler. After using several different attempts, I could not get it to work. Does anybody know what is wrong with the code below?...
0
by: teclioness | last post by:
Hi, I am using gridview for the user to update rows. In a row, there sre two columns, which need to be updated. When the gridview is to be shown, the row should show the values from database....
1
by: Tigera | last post by:
Greetings, I am trying to learn to use the Boost library, and I've run into a frustrating problem with the line marked here: #include <boost/function.hpp> #include <boost/functional.hpp>...
6
by: crack.the.hack | last post by:
Hi All, If I am changing the database machine, what should I do not to prep bind the sqc files everytime. Because I need to build my application everytime the database is changed? Is there...
5
oranoos3000
by: oranoos3000 | last post by:
hi i read about bind jqeury method general syntax as follow as bind(eventType,data,listener) Establishes a function as the event handler for the specified event type on all elements in...
1
by: victor deng | last post by:
I update db2v8 with new fix18, and do db2 "bind /home/test1/sqllib/bnd/@db2ubind.lst BLOCKING ALL GRANT PUBLIC ACTION ADD". Most of the packages already exist ,so it most errors do not matter. But...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.