PC Review


Reply
Thread Tools Rate Thread

How to bind to XML??

 
 
Dan
Guest
Posts: n/a
 
      18th Sep 2005
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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?UmFodWwgR3VwdGE=?=
Guest
Posts: n/a
 
      18th Sep 2005
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
>
>
>

 
Reply With Quote
 
Ron
Guest
Posts: n/a
 
      18th Sep 2005
"Dan" <(E-Mail Removed)> wrote in message
news:a-KdnZmvZePIKbHeRVn-(E-Mail Removed)...
> 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.


 
Reply With Quote
 
Dan
Guest
Posts: n/a
 
      18th Sep 2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Dan" <(E-Mail Removed)> wrote in message
> news:a-KdnZmvZePIKbHeRVn-(E-Mail Removed)...
> > 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.
>
>



 
Reply With Quote
 
Ron
Guest
Posts: n/a
 
      18th Sep 2005
"Dan" <(E-Mail Removed)> wrote in message
news:y8idnTOLUs4WGrDeRVn-(E-Mail Removed)...
> 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.


 
Reply With Quote
 
Ron
Guest
Posts: n/a
 
      19th Sep 2005
"Ron" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.


 
Reply With Quote
 
Dan
Guest
Posts: n/a
 
      20th Sep 2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Ron" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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.
>
>



 
Reply With Quote
 
Ron
Guest
Posts: n/a
 
      20th Sep 2005
"Dan" <(E-Mail Removed)> wrote in message
news:mbWdnVPeUbhC9LLeRVn-(E-Mail Removed)...
> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Early bind to Late bind Henk Microsoft Excel Programming 3 13th Feb 2009 12:59 AM
to bind or not to bind that is the question? Wiredless Microsoft Dot NET Compact Framework 2 2nd Jun 2005 10:00 PM
DataGrid Bind to DataSet, then Bind to DaTaview, GOT ERROR...PLS HELP A_PK Microsoft Dot NET Compact Framework 16 13th Apr 2005 04:27 AM
DataGrid Bind to DataSet, then Bind to DaTaview, GOT ERROR...PLS HELP A_PK Microsoft VB .NET 17 13th Apr 2005 04:27 AM
Re: Bind support win2k - Questions about 2000 & Bind Kenneth Porter Microsoft Windows 2000 DNS 9 13th Jul 2003 06:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:50 AM.