Re: Setting Up XML DB

From: William Ryan eMVP (dotnetguru_at_comcast.nospam.net)
Date: 05/05/04


Date: Wed, 5 May 2004 16:31:18 -0400

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
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: Setting Up XML DB
    ... When you say you loaded my XML into a dataset, exactly how did you do that? ... Wayne ... >> consist of rows where the contest data is repeated in each row. ... > arrays. ...
    (microsoft.public.dotnet.general)
  • Re: Setting Up XML DB
    ... "Wayne Wengert" wrote in message ... >> I just loaded your xml into a dataset and got two tables as expected. ... >> arrays. ...
    (microsoft.public.dotnet.general)
  • Re: Hash of hashes, of hashes, of arrays of hashes
    ... >>> I'm trying to create a data structure that will make it ... >>> easier to create a series of slightly different XML documents. ... >> string for that inner block, ... >a child that has no arrays. ...
    (comp.lang.perl.misc)
  • Re: Help with Array(s)
    ... I would think XML would return in something with an XML schema and you could ... Array.Sort sorts one-dimentional arrays, but don't think it will 2dim arrays ... to sort list by second int value and display. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: XML performance extremely slow for no obvious reason
    ... doesn't "have arrays," it sort of does, if you use a string as an array. ... For an thorough treatment of the subject of arrays and SQL Server, ... it looks like XML is probably our best bet in this situation. ... I guess it's not XML as such that's the problem, just the query optimizer ...
    (microsoft.public.sqlserver.xml)