Jump to content
Software FX Community

Problem With X-Axis


kalyan_nani
 Share

Recommended Posts

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. 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...