hello all
i make a wpf application its running well.but whenever the size of my xml is to big its running very slow every time we fetch data from xml as code below is any body suggest me it is because of this or may be other problem
how can i reform this thanks shashank`
DataSet xmlData = new DataSet();
XmlTextReader reader = null;
try
{
if (File.Exists(CommonUtils.xmlPath))
{
//convert XmlDocument to XmlTextReader
reader = new XmlTextReader(new StringReader(CommonUtils.DecryptXML().OuterXml));
//get the xml data
xmlData.ReadXml(reader);
reader.Close();
//get category rows from
DataRow[] eventRows = xmlData.Tables["M_EVENT"].Select(" ROW_STATUS=1");
if (eventRows.Length > 0)
{
//create a datatable for event
DataTable dtEvent = xmlData.Tables["M_EVENT"].Clone();
//add a default row to the event table
DataRow dr = dtEvent.NewRow();
dr[0] = "-1";
dr[1] = "--Select Event--";
dr[2] = "1";
dtEvent.Rows.InsertAt(dr, 0);
foreach (DataRow row in eventRows)
{
DataRow drEvent = dtEvent.NewRow();
drEvent["PK_EVENT_ID"] = row["PK_EVENT_ID"];
drEvent["EVENT_NAME"] = row["EVENT_NAME"];
drEvent["EVENT_TYPE"] = row["EVENT_TYPE"];
dtEvent.Rows.Add(drEvent);
}
//bind the category drop down
cmbEvent.DataContext = dtEvent.DefaultView;
cmbEvent.SelectedValuePath = "PK_EVENT_ID";
cmbEvent.DisplayMemberPath = "EVENT_NAME";
cmbEvent.SelectedIndex = 0;
}
}
else
{
Lblgetevent.Visibility = Visibility.Visible;
}
}`