J
John
I'm getting this error when i'm trying to databind my dataset to a dropdown:
DataBinding: 'System.Data.DataRowView' does not contain a property with the
name '12/12/2003'
but if I do a response.write I can see the dates fine, what is causing this
error?
code:
dYear.DataSource = dsYearofSales.Tables[1];
string strYearofSales = dsYearofSales[1].Rows[0]["SaleDate"].tostring();
dYear.DataTextField =
Convert.ToDateTime(strYearofSales).ToShortDateString();
dYear.DataValueField =
Convert.ToDateTime(strYearofSales).ToShortDateString();
but if i do
Response.write(Convert.ToDateTime(strYearofSales).ToShortDateString());
it works, so what am i missing or doing wrong?
DataBinding: 'System.Data.DataRowView' does not contain a property with the
name '12/12/2003'
but if I do a response.write I can see the dates fine, what is causing this
error?
code:
dYear.DataSource = dsYearofSales.Tables[1];
string strYearofSales = dsYearofSales[1].Rows[0]["SaleDate"].tostring();
dYear.DataTextField =
Convert.ToDateTime(strYearofSales).ToShortDateString();
dYear.DataValueField =
Convert.ToDateTime(strYearofSales).ToShortDateString();
but if i do
Response.write(Convert.ToDateTime(strYearofSales).ToShortDateString());
it works, so what am i missing or doing wrong?