S
Serdar C
hello there, i am writing a program that generates random numbers and shows
the numbers on a (x,y) chart.. i decided to use crystal reports to draw the
chart and a dataset.readxml to read data..
my problem is when i try to fil the dataset manually and type
dataset.writexml i find that theres nothing written on the xml file.. heres
the code i wrote.. please help me in this situation...
in form_load:
-----------------------------------------
ds = new DataSet();
ds.Tables.Add("numbers");
DataColumn dc = new DataColumn("number",Type.GetType("System.String"));
ds.Tables["numbers"].Columns.Add(dc);
-----------------------------------------
random number gneration and storing in dataset:
-----------------------------------------
Random r = new Random();
DataRow dr;
dr = ds.Tables[0].NewRow();
dr["numbers"] = r.NextDouble().ToString("0.#");
-----------------------------------------
and finally writing data to an xml file..
-----------------------------------------
ds.Tables[0].AcceptChanges();
ds.AcceptChanges();
ds.WriteXml("c:\\numbers.xml");
-----------------------------------------
thanx for spending your time on reading my post and have a nive year
p.s: visual basic 6.0 used to have a control for creating charts and i think
it was easier to use than crystal reports.. if u know a control in c# that i
can use please let me know..
the numbers on a (x,y) chart.. i decided to use crystal reports to draw the
chart and a dataset.readxml to read data..
my problem is when i try to fil the dataset manually and type
dataset.writexml i find that theres nothing written on the xml file.. heres
the code i wrote.. please help me in this situation...
in form_load:
-----------------------------------------
ds = new DataSet();
ds.Tables.Add("numbers");
DataColumn dc = new DataColumn("number",Type.GetType("System.String"));
ds.Tables["numbers"].Columns.Add(dc);
-----------------------------------------
random number gneration and storing in dataset:
-----------------------------------------
Random r = new Random();
DataRow dr;
dr = ds.Tables[0].NewRow();
dr["numbers"] = r.NextDouble().ToString("0.#");
-----------------------------------------
and finally writing data to an xml file..
-----------------------------------------
ds.Tables[0].AcceptChanges();
ds.AcceptChanges();
ds.WriteXml("c:\\numbers.xml");
-----------------------------------------
thanx for spending your time on reading my post and have a nive year

p.s: visual basic 6.0 used to have a control for creating charts and i think
it was easier to use than crystal reports.. if u know a control in c# that i
can use please let me know..