MySQL查询到c#与保存到XML
本文关键字:保存 XML 查询 MySQL | 更新日期: 2023-09-27 18:09:07
我有以下问题:
需要在查询中使用c# (ADO)将查询转换为数据库MySQL(并将结果保存在XML文件中)。. Net Entity framework(或LINQ to SQL),并将结果保存在XML文件
中。查询:SELECT E.ID AS `ID`, E.XML_ID AS `XML_ID`, PA.VALUE AS `ART`, CONCAT_WS(' ', EC.XML_ID, EB.NAME, E.NAME) AS `FULL_NAME`, S.NAME AS `SECTION_NAME`, I.NAME AS `IBLOCK_NAME`, concat('/catalog/', I.CODE, '/', E.IBLOCK_SECTION_ID, '/', E.ID) AS `URL`
FROM b_iblock_element E
INNER JOIN b_iblock I ON (I.ID = E.IBLOCK_ID)
LEFT JOIN b_iblock_section_element SE ON (E.ID = SE.IBLOCK_ELEMENT_ID)
LEFT JOIN b_iblock_section S ON (S.ID = SE.IBLOCK_SECTION_ID)
LEFT JOIN o_product_props PA ON (PA.PRODUCT_ID=E.ID AND PA.CODE='ART')
LEFT JOIN o_product_props PB ON (PB.PRODUCT_ID=E.ID AND PB.CODE='BRAND')
LEFT JOIN b_iblock_element EB ON (EB.ID = PB.VALUE)
LEFT JOIN o_product_props PC ON (PC.PRODUCT_ID=E.ID AND PC.CODE='PREFIX')
LEFT JOIN b_iblock_element EC ON (EC.ID = PC.VALUE)
WHERE E.WF_PARENT_ELEMENT_ID is NULL
AND(E.ACTIVE = 'Y')
AND (I.IBLOCK_TYPE_ID = 'catalog')
注:是的,我有Connector/Net for MySQL
尝试填充一个DataTable并调用WriteXml方法