alireza1268
سه شنبه 02 اردیبهشت 1393, 18:45 عصر
کسی می دونه این خطا برا چیه و چطور میشه رفعش کرد؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟ ؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟ ؟؟
Unable to cast object of type 'ProjectApplication.Tbl_Etelaat_Kharid' to type 'System.Data.DataRow'.
اینا کداییه که نوشتم :
IEnumerable
<DataRow> q =(IEnumerable<DataRow>) (from DataRow p in db.Tbl_Etelaat_Kharids.AsEnumerable()
select p);
DataSet ds = new DataSet();
DataTable dt = new DataTable();
q.CopyToDataTable<
DataRow>(dt,LoadOption.OverwriteChanges);
ds.DataSetName =
"Connection";
dt.TableName =
"EtelaatKharid";
ds.Tables.Add(dt);
stiReport1.Dictionary.DataStore.Clear();
stiReport1.RegData(
"Connection",ds);
stiReport1.Dictionary.Synchronize();
stiReport1.Render();
stiReport1.Show();
stiViewerControl1.Report = stiReport1;
رو این خط خطا میده
q.CopyToDataTable<DataRow>(dt,LoadOption.OverwriteChanges);
Unable to cast object of type 'ProjectApplication.Tbl_Etelaat_Kharid' to type 'System.Data.DataRow'.
اینا کداییه که نوشتم :
IEnumerable
<DataRow> q =(IEnumerable<DataRow>) (from DataRow p in db.Tbl_Etelaat_Kharids.AsEnumerable()
select p);
DataSet ds = new DataSet();
DataTable dt = new DataTable();
q.CopyToDataTable<
DataRow>(dt,LoadOption.OverwriteChanges);
ds.DataSetName =
"Connection";
dt.TableName =
"EtelaatKharid";
ds.Tables.Add(dt);
stiReport1.Dictionary.DataStore.Clear();
stiReport1.RegData(
"Connection",ds);
stiReport1.Dictionary.Synchronize();
stiReport1.Render();
stiReport1.Show();
stiViewerControl1.Report = stiReport1;
رو این خط خطا میده
q.CopyToDataTable<DataRow>(dt,LoadOption.OverwriteChanges);