how to get the xmlfile content from database and the content stored the particular folder. (that mean xmlfilecontent stored our appliaction).
plz give me best suggestion
your's Venkat
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ring ZhongPosted Nov 27, 2013, 2:51 AM
http://www.e-iceblue.com/Knowledgebase/Spire.DataExport/Spire.DataExport-Program-Guide/How-to-Export-Data-into-XML-in-C.html
Below is the sample code:
private void Form1_Load(object sender, EventArgs e)
{
oleDbConnection1.ConnectionString = txtConnectString.Text;
oleDbCommand1.CommandText = txtCommandText.Text;
using (OleDbDataAdapter da = new OleDbDataAdapter())
{
da.SelectCommand = oleDbCommand1;
da.SelectCommand.Connection = oleDbConnection1;
DataTable dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
}
}
private void btnExportToXml_Click(object sender, EventArgs e)
{
Spire.DataExport.XML.XMLExport xmlExport = new Spire.DataExport.XML.XMLExport();
xmlExport.DataSource = Spire.DataExport.Common.ExportSource.DataTable;
xmlExport.DataTable = this.dataGridView1.DataSource as DataTable;
xmlExport.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView;
xmlExport.FileName = @"..\..\ToXml.xml";
xmlExport.SaveToFile();
}
DEMO: http://www.e-iceblue.com/downloads/demo/spire.dataexport/introduction/ToXml.zip
hope it helps.