can llblGenPro generate code to deal with UPDATING xmlString in a field

Posts   
 
    
yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 31-May-2007 11:52:42   

version 1.0.2005.1 final (self-servicing) VS2005 asp.net 2.0


hiya,

I have an usual situation where I have an XML string inside an sqlServer table, the XML string represents the "attibutes" of a product.I can't change this at the moment, as it is referred to in a lot of client code.

schema tblProduct productId PK atrributeXML VARCHAR (500)

My problem.I need to be able to: 1) bind this XML to a gridView 2) insert, update and create attributes for a product (just as if they were in a normalised sqlServer table)

<snippedXml>

<ArrayOfAttribute xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Attribute>
    <Selections>
      <AttributeSelection>
        <Value>A) 150mm  (6")   </Value>
        <PriceAdjustment>1.25</PriceAdjustment>
      </AttributeSelection>
      <AttributeSelection>
        <Value>B) 228mm  (9")    </Value>
        <PriceAdjustment>1.50</PriceAdjustment>
      </AttributeSelection>

</snippedXml>

Now, I can bind to the XML to the gridView if I use XPath.How can I do updates etc on this XML, then save back to the database?

Believe me, I have read COUNTLESS articles that promise to be able to do this within a gridView..none of them actually show you how.

Can llblgenPro somehow generate code that will allow me to do this?Essentially, the xmlString is taking the place of an sqlServer table that lists the product's attributes.

I can expand further if required, but I have to stress that I'm under time pressure with this one disappointed disappointed

many thanks,

yogi

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 31-May-2007 14:49:52   

I think you can build a DataSet from the XML using dataSet.ReadXML(xmlString) method. Then you can bind the dataSet to the GridView.

The same way you can write back the data to the XML string using dataSet.WriteXML(xmlString).