NoCoolHandle
Programmer
Hi.
I am trying to read a column from a datatable and cant seem to get the syntax correct
Basic desire is to use a dataset to read an xml file then pick a row from the first datatable, but everytime I try it tells me I am using the datatable as a method...
Hopefully it is obvious as I cant find it. (I am a bit of a c# newbie)
code:
I am trying to read a column from a datatable and cant seem to get the syntax correct
Basic desire is to use a dataset to read an xml file then pick a row from the first datatable, but everytime I try it tells me I am using the datatable as a method...
Hopefully it is obvious as I cant find it. (I am a bit of a c# newbie)
code:
Code:
System.Data.DataSet ds = new System.Data.DataSet();
ds.ReadXmlSchema(Server.MapPath("") + "/quotes.xls");
ds.ReadXml(Server.MapPath("") + "/quotes.xml");
foreach (System.Data.DataTable dt in ds.Tables)
{
if (dt.TableName == "Table1")
{
int i = dt.Rows.Count;
Random r = new Random();
i = r.Next(0, i + 1);
divTestimonials.InnerHtml = dt.Rows(i)(0);
[green]//the above row throws an error[/green]
}
}
}