2
Reply

Gridview To XML with Custom Schema

Rhega Fhazry

Rhega Fhazry

Oct 10 2016 2:41 AM
306

  1. GetData();  
  2.               DataSet ds = new DataSet();  
  3.                DataTable dtxml = ((DataView)GVHostDtl.DataSource).Table;  
  4.                ds.Tables.Add(dtxml);  
  5.                ds.WriteXml(Server.MapPath("~/" + xmlFileName));  
i have question ..So i have Grid where the data are binding from SQL..And i will export/download file to .XML files..its success but the header table XML files are not same with "Schema" on Grid..ex= i have field 'Actual Duty On Time In' on grid but on exporting file .XML field header name changes to 'Actual_Duty_On_Time_In'
 
Data My Gridview
 
Data .XML 
 
 
 

Answers (2)