Re: Setting Up XML DB
From: Wayne Wengert (wayneDONTWANTSPAM_at_wengert.com)
Date: 05/05/04
- Next message: David Fries [MSFT]: "Re: Sorting"
- Previous message: James P: "Re: Sorting"
- In reply to: William Ryan eMVP: "Re: Setting Up XML DB"
- Next in thread: William Ryan eMVP: "Re: Setting Up XML DB"
- Reply: William Ryan eMVP: "Re: Setting Up XML DB"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 5 May 2004 16:19:45 -0600
Thanks for the continued education.
When you say you loaded my XML into a dataset, exactly how did you do that?
As for the tables, there is no link - I can easily give each show data entry
an identity value ("ShowID") and then use that as a link in the entries
table.
Wayne
"William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
news:O0CPL9tMEHA.1312@TK2MSFTNGP12.phx.gbl...
> I just loaded your xml into a dataset and got two tables as expected. In
> your dataset or object, you need a link between the two, there doesn't
> appear to be one. If one value is common in both tables, then you can use
a
> DataRelation and the rest is really easy, I can walk you through it in a
few
> minutes. However, do I understand the structure correctly in that there is
> some sort of relationship between the two, some link between the two
> tables.?
> "Wayne Wengert" <wayneDONTWANTSPAM@wengert.com> wrote in message
> news:#wnss#rMEHA.3012@tk2msftngp13.phx.gbl...
> > Thanks for the help here. I know I am confused on procedures and terms
for
> > all this. Basically, I want to end up with an XML file similar to the
one
> > shown below. I currently have 2 arrays - one with just the common show
> data
> > (showname and showdate) and another array with sets of values for each
> entry
> > (name, team, event, time).
> >
> > From what I've read I believe I want to create a new datatable for each
of
> > those 2 current arrays and define columns as appropriate? But since the
> > contest data table will have just one row and the entries table will
have
> > many rows I don't see how to build an object from which I can export the
> XML
> > I need. I've though of a cross join (right term?) where the output will
> > consist of rows where the contest data is repeated in each row. That
seems
> > inefficient?
> >
> > Any pointers are much appreciated
> >
> > ================================================
> >
> > <contest>
> > <contestinfo>
> > <contestname>South Side Contest</contestname>
> > <contestdate>2004-05-07</contestdate>
> > </contestinfo>
> > <entry>
> > <name>Johnny Jones</name>
> > <team>Marauders</team>
> > <event>Relay Race</event>
> > <time>10:30 AM</time>
> > </entry>
> > <entry>
> > <name>Mary Smith</name>
> > <team>Marauders</team>
> > <event>Relay Race</event>
> > <time>10:30 AM</time>
> > </entry>
> > <entry>
> > <name>Ed Brown</name>
> > <team>Hot Shots</team>
> > <event>200 Yd</event>
> > <time>10:45 AM</time>
> > </entry>
> > <entry>
> > <name>Jack Green</name>
> > <team>Marauders</team>
> > <event>200 Yd</event>
> > <time>10:45 AM</time>
> > </entry>
> > </contest>
> > =============================================
> >
> > Wayne
> >
> > "William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
> > news:ehM7$4qMEHA.936@TK2MSFTNGP11.phx.gbl...
> > > Hi Wayne:
> > >
> > > What part do you need? I'll try to find something in particular.
> > >
> > > if you have a datatab;le, the rest is easy:
> > >
> > > DataSet ds = new DataSet();
> > > ds.Tables.Add(DataTableYouCretaed);
> > > ds.WriteXML(@"Path:\Fielname.xml");
> > >
> > > then, set up a dataadapter and just call update
> > > dataAdapter1.Update(ds.Tables[0]) //you may need multiple adapters
> > depending
> > > on how many tables you have.
> > >
> > > HTH,
> > >
> > > Bill
> > > "Wayne Wengert" <wayneDONTWANTSPAM@wengert.com> wrote in message
> > > news:uplJDxqMEHA.2780@TK2MSFTNGP09.phx.gbl...
> > > > William;
> > > >
> > > > Thanks for the reply. Do you have a pointer to information or
examples
> > of
> > > > how to accomplish this? I am feeling like it is a catch 22 since the
> > only
> > > > way I see to get a datatable is to have a dataset to contain it but
I
> > have
> > > > not yet created the dataset. I am unsure of how to accomplish this.
> > > >
> > > > Wayne
> > > >
> > > > "William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
> > > > news:%23UdeCkqMEHA.2500@TK2MSFTNGP12.phx.gbl...
> > > > > One easy way is to load the data into a datatable instead of
arrays,
> > or
> > > > use
> > > > > the arrays to load a datatable. Put the datatable in a dataset
and
> > use
> > > > the
> > > > > .WriteXML method to write it and DataSet.ReadXML to read it.
> > > > >
> > > > > You can also make your Arrays memebers of a class and mark the
class
> > as
> > > > > Serializable and use the serialization libraries to accomplish
this.
> > > > >
> > > > > HTH,
> > > > >
> > > > > Bill
> > > > > "Wayne Wengert" <wayneDONTWANTSPAM@wengert.com> wrote in message
> > > > > news:OVwI50pMEHA.1556@TK2MSFTNGP10.phx.gbl...
> > > > > > I am trying to build a VB.NET Windows application in which I
want
> to
> > > > > create
> > > > > > an XML file from data collected from the user and stored in
> arrays.
> > I
> > > am
> > > > > > looking for any pointers to information on how to accomplish
this.
> > > > > >
> > > > > > TIA
> > > > > >
> > > > > > Wayne
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
- Next message: David Fries [MSFT]: "Re: Sorting"
- Previous message: James P: "Re: Sorting"
- In reply to: William Ryan eMVP: "Re: Setting Up XML DB"
- Next in thread: William Ryan eMVP: "Re: Setting Up XML DB"
- Reply: William Ryan eMVP: "Re: Setting Up XML DB"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|