473,473 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Filtering concept - Not really but not sure what else to a call it.

Hello,

I'll try to explain this the best I can. I am using VS2005/c# and this
is a web app. I have some data in the format of:

Ford Focus 2000
Ford Focus 2001
Ford Focus 2002
Ford Mustang 2004
Ford Mustang 2005
Dodge Ram 2003
Dodge Ram 2004
Dodge Ram 2005
Dodge Ram 2006

I am trying to create an XML file from this data that would look
something like.

<subgroup1 text = "Ford">
<subgroup2 text = "Focus">
<subgroup2a text = "2000">
</subgroup2a>
<subgroup2b text = "2001">
</subgroup2b>
</subgroup2>
</subgroup1>

I was thinking I would need to create something like three variables
and then loop through it and see if the next line of data matched the
previous and if not what value changed. I am just wondering if there
is a better way.

Thanks,
Greg

Dec 5 '06 #1
6 1091
Wouldn't a better XML structure look more like:

<cars>
<car>
<make>Ford</make>
<model>Focus</model>
<year>2000</year>
</car>
<car>
<make>Ford</make>
<model>Focus</model>
<year>2001></year>
</car>
<car>
Dec 5 '06 #2
Hi

Lets make the thing simple....Move data to a DBTable.... to get it
filtered... SELECT * from table WHERE ****

Hope you like it...

Thanks
-Srinivas.

hartbypass wrote:
Hello,

I'll try to explain this the best I can. I am using VS2005/c# and this
is a web app. I have some data in the format of:

Ford Focus 2000
Ford Focus 2001
Ford Focus 2002
Ford Mustang 2004
Ford Mustang 2005
Dodge Ram 2003
Dodge Ram 2004
Dodge Ram 2005
Dodge Ram 2006

I am trying to create an XML file from this data that would look
something like.

<subgroup1 text = "Ford">
<subgroup2 text = "Focus">
<subgroup2a text = "2000">
</subgroup2a>
<subgroup2b text = "2001">
</subgroup2b>
</subgroup2>
</subgroup1>

I was thinking I would need to create something like three variables
and then loop through it and see if the next line of data matched the
previous and if not what value changed. I am just wondering if there
is a better way.

Thanks,
Greg
Dec 5 '06 #3
This is also a simple solution !!!
liked it!!

Thanks
-Srinivas.

Peter Bradley wrote:
Wouldn't a better XML structure look more like:

<cars>
<car>
<make>Ford</make>
<model>Focus</model>
<year>2000</year>
</car>
<car>
<make>Ford</make>
<model>Focus</model>
<year>2001></year>
</car>
<car>
.
.
.
</car>
</cars>

or perhaps:

<cars>
<car make="Ford" model="Focus" year="2000" />
<car make="Ford" model="Focus" year="2001" />
<car ...
</cars>

Depending on whether you like elements or attributes. I think I'd prefer
attributes in this case.

Just a thought. Sorry if it's not helpful.
Peter

"hartbypass" <gh***@medex.comwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
Hello,

I'll try to explain this the best I can. I am using VS2005/c# and this
is a web app. I have some data in the format of:

Ford Focus 2000
Ford Focus 2001
Ford Focus 2002
Ford Mustang 2004
Ford Mustang 2005
Dodge Ram 2003
Dodge Ram 2004
Dodge Ram 2005
Dodge Ram 2006

I am trying to create an XML file from this data that would look
something like.

<subgroup1 text = "Ford">
<subgroup2 text = "Focus">
<subgroup2a text = "2000">
</subgroup2a>
<subgroup2b text = "2001">
</subgroup2b>
</subgroup2>
</subgroup1>

I was thinking I would need to create something like three variables
and then loop through it and see if the next line of data matched the
previous and if not what value changed. I am just wondering if there
is a better way.

Thanks,
Greg
Dec 5 '06 #4
Thanks for the fast responses.

The data is in a database already, the end result it that I am trying
to stick it in to the tree control. So the suggested xml structures
will not work for what I need. I need to be able to See all the fords
under the ford branch and then all the focus' under the focus branch
that is under the ford branch. I guess I was looking more for code to
parse that data than suggestions on better formatting XML. Sorry if I
was not clear.

Thanks,
Greg

Duggi wrote:
Hi

Lets make the thing simple....Move data to a DBTable.... to get it
filtered... SELECT * from table WHERE ****

Hope you like it...

Thanks
-Srinivas.

hartbypass wrote:
Hello,

I'll try to explain this the best I can. I am using VS2005/c# and this
is a web app. I have some data in the format of:

Ford Focus 2000
Ford Focus 2001
Ford Focus 2002
Ford Mustang 2004
Ford Mustang 2005
Dodge Ram 2003
Dodge Ram 2004
Dodge Ram 2005
Dodge Ram 2006

I am trying to create an XML file from this data that would look
something like.

<subgroup1 text = "Ford">
<subgroup2 text = "Focus">
<subgroup2a text = "2000">
</subgroup2a>
<subgroup2b text = "2001">
</subgroup2b>
</subgroup2>
</subgroup1>

I was thinking I would need to create something like three variables
and then loop through it and see if the next line of data matched the
previous and if not what value changed. I am just wondering if there
is a better way.

Thanks,
Greg
Dec 5 '06 #5
Thanks for the fast responses.

The data is in a database already, the end result it that I am trying
to stick it in to the tree control. So the suggested xml structures
will not work for what I need. I need to be able to See all the fords
under the ford branch and then all the focus' under the focus branch
that is under the ford branch. I guess I was looking more for code to
parse that data than suggestions on better formatting XML. Sorry if I
was not clear.

Thanks,
Greg

Duggi wrote:
Hi

Lets make the thing simple....Move data to a DBTable.... to get it
filtered... SELECT * from table WHERE ****

Hope you like it...

Thanks
-Srinivas.

hartbypass wrote:
Hello,

I'll try to explain this the best I can. I am using VS2005/c# and this
is a web app. I have some data in the format of:

Ford Focus 2000
Ford Focus 2001
Ford Focus 2002
Ford Mustang 2004
Ford Mustang 2005
Dodge Ram 2003
Dodge Ram 2004
Dodge Ram 2005
Dodge Ram 2006

I am trying to create an XML file from this data that would look
something like.

<subgroup1 text = "Ford">
<subgroup2 text = "Focus">
<subgroup2a text = "2000">
</subgroup2a>
<subgroup2b text = "2001">
</subgroup2b>
</subgroup2>
</subgroup1>

I was thinking I would need to create something like three variables
and then loop through it and see if the next line of data matched the
previous and if not what value changed. I am just wondering if there
is a better way.

Thanks,
Greg
Dec 5 '06 #6
Got it....

You can do a query of data base with ORDERBY ....

SELECT "column_name"
FROM "table_name"
[WHERE "condition"]
ORDER BY "column_name" [ASC, DESC]

this will sort all the rows.. where ever there is a change in the
cartype come back to root node... Will this help???

I think you can also bind the data to the control.. with data binding
feature....Ofcourse after ORDERBY.

Thanks
-Srinivas.

hartbypass wrote:
Hello,

I'll try to explain this the best I can. I am using VS2005/c# and this
is a web app. I have some data in the format of:

Ford Focus 2000
Ford Focus 2001
Ford Focus 2002
Ford Mustang 2004
Ford Mustang 2005
Dodge Ram 2003
Dodge Ram 2004
Dodge Ram 2005
Dodge Ram 2006

I am trying to create an XML file from this data that would look
something like.

<subgroup1 text = "Ford">
<subgroup2 text = "Focus">
<subgroup2a text = "2000">
</subgroup2a>
<subgroup2b text = "2001">
</subgroup2b>
</subgroup2>
</subgroup1>

I was thinking I would need to create something like three variables
and then loop through it and see if the next line of data matched the
previous and if not what value changed. I am just wondering if there
is a better way.

Thanks,
Greg
Dec 6 '06 #7

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

Similar topics

1
by: N.K. | last post by:
Hello, I'm trying to find a way to flexibly filter a column in a row of data read from a file. I will have data type of that column, the operation to be performed on it (like >, <, <= etc.) and the...
4
by: Paul Rubin | last post by:
Anyone know if there's code around to filter text through an external process? Sort of like the Emacs "filter-region" command. For example, say I have a program that reads input in English and...
1
by: Alex Satrapa | last post by:
I have a table from which I'm trying to extract certain information. For historical reasons, we archive every action on a particular thing ('thing' is identified, funnily enough, by 'id'). So the...
19
by: William Wisnieski | last post by:
Hello Everyone, I have a main form with a datasheet subform that I use to query by form. After the user selects two criteria on the main form and clicks the cmdShowResults button on the main...
8
by: | last post by:
hi, i have a form on which a user can choose specific criteria such as dates etc, in order to filter the report that is called from the form. i do this by using the Where section of the...
0
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
5
by: LDD | last post by:
Hi Folks I'm trying to determine a way to handle paging, filtering and sorting in a datagrid. If I choose to filter and sort, I'd like to return a subset. If that resultset has more records...
3
by: Shawn Ramirez | last post by:
As with most web applications speed is a huge deal to me in my applications. My customers don't really care if my app is a true 3 tier application or not, they just want it to be faster then it was...
2
by: Kevin | last post by:
I want to use a set of check boxes to narrow down entries on a subform. I.e. a check box for black, red & green to describe the colors of a product. So a use clicks Black and only black products...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.