- GetData();
- DataSet ds = new DataSet();
- DataTable dtxml = ((DataView)GVHostDtl.DataSource).Table;
- ds.Tables.Add(dtxml);
- 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

ali tuncerRank #1,499 · 1.1K reputationPosted Oct 10, 2016, 12:00 AM EDT
I guess Actual_Duty_On_Time_In is your column name in database, in your query you can give alias, for example :
Select Actual_Duty_On_Time_In as 'Actual Duty On Time In'
Rhega Fhazry3 reputationPosted Oct 10, 2016, 4:14 PM EDT