S
Stephen Witter
I am using WriteXml to output data to an xml file, and and XML web
control to display it. The code runs fine, however my groups are
being ignored. For Instance, the current output is:
<NewDataSet>
<Table>
<PRODUCT_CODE>RM-Safety</PRODUCT_CODE>
<PART_ID>*61177-000</PART_ID>
<PART_DESCRIPTION>LABEL POUCH 1 PACK SOLO KR
AXIA</PART_DESCRIPTION>
<LABOR_COST>0</LABOR_COST>
<MATERIAL_COST>0.061000</MATERIAL_COST>
<BURDEN_COST>0</BURDEN_COST>
<SERVICE_COST>0</SERVICE_COST>
<TOTAL_VALUE>0</TOTAL_VALUE>
</Table>
<NewDataSet>
The "PRODUCT_CODE" is the group. I would like it to be:
<NewDataSet>
<Table>
<PRODUCT_GROUP>
<PRODUCT_CODE>RM-Safety</PRODUCT_CODE>
<DETAIL>
<PART_ID>*61177-000</PART_ID>
<PART_DESCRIPTION>LABEL POUCH 1 PACK SOLO KR
AXIA</PART_DESCRIPTION>
<LABOR_COST>0</LABOR_COST>
<MATERIAL_COST>0.061000</MATERIAL_COST>
<BURDEN_COST>0</BURDEN_COST>
<SERVICE_COST>0</SERVICE_COST>
<TOTAL_VALUE>0</TOTAL_VALUE>
</DETAIL>
</PRODUCT_GROUP>
</Table>
<NewDataSet>
My query is using a group by clause but the data always comes out the
same. Here is my code:
Dim SelectCommand As String = "SELECT top 100 PRODUCT_CODE,
PART_ID, PART_DESCRIPTION, LABOR_COST, MATERIAL_COST, " _
& "BURDEN_COST, SERVICE_COST,
TOTAL_VALUE FROM RV_INVENTORY_VALUATION_MONTHEND " _
& "GROUP BY PRODUCT_CODE, PART_ID,
PART_DESCRIPTION, LABOR_COST, MATERIAL_COST, " _
& "BURDEN_COST, SERVICE_COST,
TOTAL_VALUE"
Dim myConnection As New SqlConnection(ConnectionString)
Dim myCommand As New SqlDataAdapter(SelectCommand,
myConnection)
Dim ds As New DataSet()
myCommand.Fill(ds)
ds.WriteXml(server.mappath("../Administration/Month End
Inventory Valuation.xml"), XmlWriteMode.IgnoreSchema)
I appreciate any help.
control to display it. The code runs fine, however my groups are
being ignored. For Instance, the current output is:
<NewDataSet>
<Table>
<PRODUCT_CODE>RM-Safety</PRODUCT_CODE>
<PART_ID>*61177-000</PART_ID>
<PART_DESCRIPTION>LABEL POUCH 1 PACK SOLO KR
AXIA</PART_DESCRIPTION>
<LABOR_COST>0</LABOR_COST>
<MATERIAL_COST>0.061000</MATERIAL_COST>
<BURDEN_COST>0</BURDEN_COST>
<SERVICE_COST>0</SERVICE_COST>
<TOTAL_VALUE>0</TOTAL_VALUE>
</Table>
<NewDataSet>
The "PRODUCT_CODE" is the group. I would like it to be:
<NewDataSet>
<Table>
<PRODUCT_GROUP>
<PRODUCT_CODE>RM-Safety</PRODUCT_CODE>
<DETAIL>
<PART_ID>*61177-000</PART_ID>
<PART_DESCRIPTION>LABEL POUCH 1 PACK SOLO KR
AXIA</PART_DESCRIPTION>
<LABOR_COST>0</LABOR_COST>
<MATERIAL_COST>0.061000</MATERIAL_COST>
<BURDEN_COST>0</BURDEN_COST>
<SERVICE_COST>0</SERVICE_COST>
<TOTAL_VALUE>0</TOTAL_VALUE>
</DETAIL>
</PRODUCT_GROUP>
</Table>
<NewDataSet>
My query is using a group by clause but the data always comes out the
same. Here is my code:
Dim SelectCommand As String = "SELECT top 100 PRODUCT_CODE,
PART_ID, PART_DESCRIPTION, LABOR_COST, MATERIAL_COST, " _
& "BURDEN_COST, SERVICE_COST,
TOTAL_VALUE FROM RV_INVENTORY_VALUATION_MONTHEND " _
& "GROUP BY PRODUCT_CODE, PART_ID,
PART_DESCRIPTION, LABOR_COST, MATERIAL_COST, " _
& "BURDEN_COST, SERVICE_COST,
TOTAL_VALUE"
Dim myConnection As New SqlConnection(ConnectionString)
Dim myCommand As New SqlDataAdapter(SelectCommand,
myConnection)
Dim ds As New DataSet()
myCommand.Fill(ds)
ds.WriteXml(server.mappath("../Administration/Month End
Inventory Valuation.xml"), XmlWriteMode.IgnoreSchema)
I appreciate any help.