Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Need help designing XML Dataset

Reply
Thread Tools

Need help designing XML Dataset

 
 
Tony Girgenti
Guest
Posts: n/a
 
      09-16-2006
Hello

I developed and tested a web application using VS.NET 2003, VB, .NET
Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1. It uses a web form.

I tried doing this without any help, but i'm getting nowhere.

I want to create an XML schema (XSD) for a dataset/datatable using the XML
designer.

I want to be able to have a table for each trip. The trip will contain a
trip no, date etc. But i also want it to have a State element like "PA, NJ,
MD" for each state with miles traveled for each state. I don't want to
enter 50 elements name MilesPA, MilesNJ, MilesMD etc.

Is there a way to define an array of states for the trip table without doing
each state individually ? How would i reference the table/array in code ?

Any help would be gratefully appreciated.

Thanks,
Tony


 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      09-16-2006
Create a table with the states in it. Add a reference in your other table.
Add both tables to the same dataset. Add a relationship between the tables
in the DataSet. You can now refer to the parent (state) records from the
other table.

If you then want to query a single state, you can filter on the records that
are linked to the state in question.

Hope this helps.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
"Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
news:(E-Mail Removed)...
> Hello
>
> I developed and tested a web application using VS.NET 2003, VB, .NET
> Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1. It uses a web form.
>
> I tried doing this without any help, but i'm getting nowhere.
>
> I want to create an XML schema (XSD) for a dataset/datatable using the XML
> designer.
>
> I want to be able to have a table for each trip. The trip will contain a
> trip no, date etc. But i also want it to have a State element like "PA,
> NJ, MD" for each state with miles traveled for each state. I don't want
> to enter 50 elements name MilesPA, MilesNJ, MilesMD etc.
>
> Is there a way to define an array of states for the trip table without
> doing each state individually ? How would i reference the table/array in
> code ?
>
> Any help would be gratefully appreciated.
>
> Thanks,
> Tony
>



 
Reply With Quote
 
 
 
 
Tony Girgenti
Guest
Posts: n/a
 
      09-17-2006
Hello Cowboy.

Thanks for your help with this.

I don't see how what you are saying help's me. Here is what i have:
Trip DataTable
Tripno
Tractorno
Location
Date
Mileage in state (can occur as many as 50 times, one for each state or
can be just 1 state)
Fuel in state (can occur as many as 50 times, one for each state or can
be just 1 state)
Tolls

So, instead of adding fifty elements state(twice, 1 for mileage and 1 for
fuel), i want to just say it once and use some kind of index to loop thru
the states for each trip.

There will always be at least 1 state for each trip.

I hope that makes sense. I don't know how to do that with the xml designer.
I also don't know how to put it in code to access the individual columns for
each trip.

Thanks
Tony

"Cowboy (Gregory A. Beamer)" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Create a table with the states in it. Add a reference in your other table.
> Add both tables to the same dataset. Add a relationship between the tables
> in the DataSet. You can now refer to the parent (state) records from the
> other table.
>
> If you then want to query a single state, you can filter on the records
> that are linked to the state in question.
>
> Hope this helps.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> *************************************************
> Think outside of the box!
> *************************************************
> "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
> news:(E-Mail Removed)...
>> Hello
>>
>> I developed and tested a web application using VS.NET 2003, VB, .NET
>> Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1. It uses a web form.
>>
>> I tried doing this without any help, but i'm getting nowhere.
>>
>> I want to create an XML schema (XSD) for a dataset/datatable using the
>> XML designer.
>>
>> I want to be able to have a table for each trip. The trip will contain a
>> trip no, date etc. But i also want it to have a State element like "PA,
>> NJ, MD" for each state with miles traveled for each state. I don't want
>> to enter 50 elements name MilesPA, MilesNJ, MilesMD etc.
>>
>> Is there a way to define an array of states for the trip table without
>> doing each state individually ? How would i reference the table/array in
>> code ?
>>
>> Any help would be gratefully appreciated.
>>
>> Thanks,
>> Tony
>>

>
>



 
Reply With Quote
 
Max Schneider, Image Innovation
Guest
Posts: n/a
 
      09-17-2006
What about adding an element that occurs from 1..n that has an attribute of
the state code? A sample XML would be:

<Trip>
<Miles state="OH">75</Miles>
<Miles state="KY">300</Miles>
<Miles state="TN">100</Miles>
</Trip>


Regards,

Max

"Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
news:(E-Mail Removed)...
> Hello Cowboy.
>
> Thanks for your help with this.
>
> I don't see how what you are saying help's me. Here is what i have:
> Trip DataTable
> Tripno
> Tractorno
> Location
> Date
> Mileage in state (can occur as many as 50 times, one for each state or
> can be just 1 state)
> Fuel in state (can occur as many as 50 times, one for each state or can
> be just 1 state)
> Tolls
>
> So, instead of adding fifty elements state(twice, 1 for mileage and 1 for
> fuel), i want to just say it once and use some kind of index to loop thru
> the states for each trip.
>
> There will always be at least 1 state for each trip.
>
> I hope that makes sense. I don't know how to do that with the xml
> designer. I also don't know how to put it in code to access the individual
> columns for each trip.
>
> Thanks
> Tony
>
> "Cowboy (Gregory A. Beamer)" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
>> Create a table with the states in it. Add a reference in your other
>> table. Add both tables to the same dataset. Add a relationship between
>> the tables in the DataSet. You can now refer to the parent (state)
>> records from the other table.
>>
>> If you then want to query a single state, you can filter on the records
>> that are linked to the state in question.
>>
>> Hope this helps.
>>
>> --
>> Gregory A. Beamer
>> MVP; MCP: +I, SE, SD, DBA
>>
>> *************************************************
>> Think outside of the box!
>> *************************************************
>> "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
>> news:(E-Mail Removed)...
>>> Hello
>>>
>>> I developed and tested a web application using VS.NET 2003, VB, .NET
>>> Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1. It uses a web form.
>>>
>>> I tried doing this without any help, but i'm getting nowhere.
>>>
>>> I want to create an XML schema (XSD) for a dataset/datatable using the
>>> XML designer.
>>>
>>> I want to be able to have a table for each trip. The trip will contain
>>> a trip no, date etc. But i also want it to have a State element like
>>> "PA, NJ, MD" for each state with miles traveled for each state. I don't
>>> want to enter 50 elements name MilesPA, MilesNJ, MilesMD etc.
>>>
>>> Is there a way to define an array of states for the trip table without
>>> doing each state individually ? How would i reference the table/array
>>> in code ?
>>>
>>> Any help would be gratefully appreciated.
>>>
>>> Thanks,
>>> Tony
>>>

>>
>>

>
>



 
Reply With Quote
 
Tony Girgenti
Guest
Posts: n/a
 
      09-17-2006
Hello Max.

It looks like you are creating XML data. I'm looking for how to define the
data with a schema.

Thanks,
Tony

"Max Schneider, Image Innovation" <(E-Mail Removed)> wrote in
message news:z34Pg.33$(E-Mail Removed)...
> What about adding an element that occurs from 1..n that has an attribute
> of the state code? A sample XML would be:
>
> <Trip>
> <Miles state="OH">75</Miles>
> <Miles state="KY">300</Miles>
> <Miles state="TN">100</Miles>
> </Trip>
>
>
> Regards,
>
> Max
>
> "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
> news:(E-Mail Removed)...
>> Hello Cowboy.
>>
>> Thanks for your help with this.
>>
>> I don't see how what you are saying help's me. Here is what i have:
>> Trip DataTable
>> Tripno
>> Tractorno
>> Location
>> Date
>> Mileage in state (can occur as many as 50 times, one for each state or
>> can be just 1 state)
>> Fuel in state (can occur as many as 50 times, one for each state or
>> can be just 1 state)
>> Tolls
>>
>> So, instead of adding fifty elements state(twice, 1 for mileage and 1 for
>> fuel), i want to just say it once and use some kind of index to loop thru
>> the states for each trip.
>>
>> There will always be at least 1 state for each trip.
>>
>> I hope that makes sense. I don't know how to do that with the xml
>> designer. I also don't know how to put it in code to access the
>> individual columns for each trip.
>>
>> Thanks
>> Tony
>>
>> "Cowboy (Gregory A. Beamer)" <(E-Mail Removed)> wrote in
>> message news:(E-Mail Removed)...
>>> Create a table with the states in it. Add a reference in your other
>>> table. Add both tables to the same dataset. Add a relationship between
>>> the tables in the DataSet. You can now refer to the parent (state)
>>> records from the other table.
>>>
>>> If you then want to query a single state, you can filter on the records
>>> that are linked to the state in question.
>>>
>>> Hope this helps.
>>>
>>> --
>>> Gregory A. Beamer
>>> MVP; MCP: +I, SE, SD, DBA
>>>
>>> *************************************************
>>> Think outside of the box!
>>> *************************************************
>>> "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
>>> news:(E-Mail Removed)...
>>>> Hello
>>>>
>>>> I developed and tested a web application using VS.NET 2003, VB, .NET
>>>> Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1. It uses a web form.
>>>>
>>>> I tried doing this without any help, but i'm getting nowhere.
>>>>
>>>> I want to create an XML schema (XSD) for a dataset/datatable using the
>>>> XML designer.
>>>>
>>>> I want to be able to have a table for each trip. The trip will contain
>>>> a trip no, date etc. But i also want it to have a State element like
>>>> "PA, NJ, MD" for each state with miles traveled for each state. I
>>>> don't want to enter 50 elements name MilesPA, MilesNJ, MilesMD etc.
>>>>
>>>> Is there a way to define an array of states for the trip table without
>>>> doing each state individually ? How would i reference the table/array
>>>> in code ?
>>>>
>>>> Any help would be gratefully appreciated.
>>>>
>>>> Thanks,
>>>> Tony
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
smadden
Guest
Posts: n/a
 
      09-17-2006
I agree. Why not just add attribute state, and then enumerate the
value for each of the 50 states.


Max Schneider, Image Innovation wrote:
> What about adding an element that occurs from 1..n that has an attribute of
> the state code? A sample XML would be:
>
> <Trip>
> <Miles state="OH">75</Miles>
> <Miles state="KY">300</Miles>
> <Miles state="TN">100</Miles>
> </Trip>
>
>
> Regards,
>
> Max
>
> "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
> news:(E-Mail Removed)...
> > Hello Cowboy.
> >
> > Thanks for your help with this.
> >
> > I don't see how what you are saying help's me. Here is what i have:
> > Trip DataTable
> > Tripno
> > Tractorno
> > Location
> > Date
> > Mileage in state (can occur as many as 50 times, one for each state or
> > can be just 1 state)
> > Fuel in state (can occur as many as 50 times, one for each state or can
> > be just 1 state)
> > Tolls
> >
> > So, instead of adding fifty elements state(twice, 1 for mileage and 1 for
> > fuel), i want to just say it once and use some kind of index to loop thru
> > the states for each trip.
> >
> > There will always be at least 1 state for each trip.
> >
> > I hope that makes sense. I don't know how to do that with the xml
> > designer. I also don't know how to put it in code to access the individual
> > columns for each trip.
> >
> > Thanks
> > Tony
> >
> > "Cowboy (Gregory A. Beamer)" <(E-Mail Removed)> wrote in
> > message news:(E-Mail Removed)...
> >> Create a table with the states in it. Add a reference in your other
> >> table. Add both tables to the same dataset. Add a relationship between
> >> the tables in the DataSet. You can now refer to the parent (state)
> >> records from the other table.
> >>
> >> If you then want to query a single state, you can filter on the records
> >> that are linked to the state in question.
> >>
> >> Hope this helps.
> >>
> >> --
> >> Gregory A. Beamer
> >> MVP; MCP: +I, SE, SD, DBA
> >>
> >> *************************************************
> >> Think outside of the box!
> >> *************************************************
> >> "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message
> >> news:(E-Mail Removed)...
> >>> Hello
> >>>
> >>> I developed and tested a web application using VS.NET 2003, VB, .NET
> >>> Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1. It uses a web form.
> >>>
> >>> I tried doing this without any help, but i'm getting nowhere.
> >>>
> >>> I want to create an XML schema (XSD) for a dataset/datatable using the
> >>> XML designer.
> >>>
> >>> I want to be able to have a table for each trip. The trip will contain
> >>> a trip no, date etc. But i also want it to have a State element like
> >>> "PA, NJ, MD" for each state with miles traveled for each state. I don't
> >>> want to enter 50 elements name MilesPA, MilesNJ, MilesMD etc.
> >>>
> >>> Is there a way to define an array of states for the trip table without
> >>> doing each state individually ? How would i reference the table/array
> >>> in code ?
> >>>
> >>> Any help would be gratefully appreciated.
> >>>
> >>> Thanks,
> >>> Tony
> >>>
> >>
> >>

> >
> >


 
Reply With Quote
 
=?Utf-8?B?RGFuaWVsIEJyaXR0YWluIER1Z2dlcg==?=
Guest
Posts: n/a
 
      09-24-2006
Tony:

I am not familiar with VS 2003. I started with .net 2.0 and VS 2005. The way
that I would handle this situation is as follows:

I would create two data tables:

1. TblTrips
2. TblTripDetails

TblTrips would have the following fields:

ID
TripNo
TractorNo

TblTripDetails would have the following fields:
ID
TripNo
Location
Date
MilesIn
FuelIn
Tolls

I am assuming that location is the state. If it is not, just replace
Location with state and insert State into TblTrips.

You can then establish a relationship in the designer. In code you can
create a datarow collection (array) and access all of the children based on
the trip id.

Hope this helps,


Daniel Brittain Dugger

TblTripDetails would have the following
"Tony Girgenti" wrote:

> Hello
>
> I developed and tested a web application using VS.NET 2003, VB, .NET
> Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1. It uses a web form.
>
> I tried doing this without any help, but i'm getting nowhere.
>
> I want to create an XML schema (XSD) for a dataset/datatable using the XML
> designer.
>
> I want to be able to have a table for each trip. The trip will contain a
> trip no, date etc. But i also want it to have a State element like "PA, NJ,
> MD" for each state with miles traveled for each state. I don't want to
> enter 50 elements name MilesPA, MilesNJ, MilesMD etc.
>
> Is there a way to define an array of states for the trip table without doing
> each state individually ? How would i reference the table/array in code ?
>
> Any help would be gratefully appreciated.
>
> Thanks,
> Tony
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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
need help in designing normalization ledinhkha@gmail.com VHDL 4 09-06-2006 10:10 AM
Help designing reading/writing a xml-fileformat Jacob Kroon Python 2 12-13-2005 11:23 PM
Dataset>XML>SQLText field>XML>Dataset thomas@humphries.com ASP .Net 0 07-12-2005 03:52 AM
Need help designing a way to flip through articles =?Utf-8?B?dHBlcnJp?= ASP .Net 1 06-27-2005 02:56 PM
dataset.Databind error when dataset XML contains attributes... ringo ASP .Net Datagrid Control 0 08-18-2004 05:28 PM



Advertisments