kalyan_nani Posted August 14, 2007 Report Share Posted August 14, 2007 Hi, I am using chartFX7 for visual studio 2005. To avoid multiple database hits i am writing the entire dataset to a XML file using following piece of code. ************************************************CODE*********************************************************** protected void writeTOXML() { XmlTextReader XTReader = new XmlTextReader(ds.GetXml(), XmlNodeType.Element, null); XmlTextWriter XTWriter = new XmlTextWriter(CommonFunctions.getXMLPath(), Encoding.UTF8); XTWriter.WriteStartDocument(); string fldName = string.Empty; while (XTReader.Read()) { switch (XTReader.NodeType) { case XmlNodeType.Element: XTWriter.WriteStartElement(XTReader.Name); fldName = XTReader.Name; break; case XmlNodeType.Text: if (fldName == "EDATE") { DateTime dt = DateTime.Parse(XTReader.Value.ToString()); XTWriter.WriteString(dt.ToString("MM/dd/yyyy")); } else { XTWriter.WriteString(XTReader.Value); } break; case XmlNodeType.EndElement: XTWriter.WriteEndElement(); break; } } XTWriter.Close(); } ***********************************************CODE************************************************************ when ever a need arises I am reading this XML file using ds.readXML() and i am assigning this dataset to my chart. But I am getting string format exception. I think problem with EDATE column(date column in the database). In XML file the EDATE column data was written in string format. Is there any way to assign a date in string format value to X-Axis. Please advise me. Quote Link to comment Share on other sites More sharing options...
JuanC Posted August 16, 2007 Report Share Posted August 16, 2007 How are you pasing the data to the chart? You may want to try using the XmlDataProvider class (ChartFX.WebForms.DataProviders namespace). This class will allow you to specify the DateFormat used to parse your XML. JuanC Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.