Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using xml data in a gridview cintrol

Status
Not open for further replies.

mainship

Programmer
Sep 14, 1999
5
0
0
US
I can find lots if info on populating a GridView control from an xml datasource, but what I need to do is make use of the xml data in an sql database table.

I'm working with an open source shopping cart, trying to find a way to add some inventory functionality. I don't want to track inventory for each item, I need to track it for each color of each item. So if I have two handbags, and one comes in two colors and the other in three, I have five lines in the gridview.

The colors are considered attributes and are kept in xml format in an attribute field. Each color has an inventory amount associated with it. Other attributes may also be in the attributes field.

How can I extract the information I need?

Diane
 
Why is some of the product information in a database, and some in an xml file? It would make much more sense to pick one or the other depending on your available options.


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
All the product information is in the database, but one of the fields contains the attributes in xml format.

 
I don't understand how it would help me to populate an XMLDocument from the string. I want to incorporate the data into a gridview. I also need to modify the inventory when sales take place.

Diane
 
Well you have xml in the database right? So, if you place this xml into a XMLDocument control, you can then bind this xml document to a data control.


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
Oh, and because you are going to have to use another control to display this xml data, you will need to read up on how to create these (i.e. nested repeaters, nested gridviews etc).


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top