求解送分!! 为什么返回的dataset 是空的????????
DataTable dt = new DataTable();
DataRow dr;
dt.Columns.Add(new DataColumn( "Text7 ", typeof(string)));
dt.Columns.Add(new DataColumn( "Text8 ", typeof(string)));
dr = dt.NewRow();
dr[0] = "站 ";
dr[1] = "syan ";
dt.Rows.Add(dr);
return dt;
DataTable i10 = CreateDataSource(); <-----这个函数就是上面的东西返回的是空的!!!!!!!!!!1
DataSet set = new DataSet();
set.Tables.Add(i10);
set.Tables[0].TableName = "i10 ";
ReportDocument CReport11 = new CrystalReport1();
CReport11.SetDataSource(set); <--------这句调试提示 "报表不含表 "?
什么意思 啊 怎么解决啊 !??!
------解决方案--------------------Customers = new DataTable( "Customers ");
Customers.Columns.Add( "CustLName ", typeof(String));
Customers.Columns.Add( "CustFName ", typeof(String));
Customers.Columns.Add( "CustCName ", typeof(String));
Customers.Columns.Add( "CustNName ", typeof(String));
DataRow workRow;
for (int i = 0; i <= 9; i++)
{
workRow = Customers.NewRow();
workRow[0] = i;
workRow[1] = "CustLName " + i.ToString();
workRow[2] = "CustFName " + i.ToString();
workRow[3] = "CustCName " + i.ToString(); Customers.Rows.Add(workRow);
}
myDataSet = new DataSet();
// Add the new DataTable to the DataSet.
myDataSet.Tables.Add(Customers);
自己程序测试通过
------解决方案--------------------看了好几遍也没看出来错误。。。。
------解决方案--------------------学习
------解决方案--------------------CReport11是空表?那就有问题了。
你赋的DATASET它没地方能对上号,就所你没表呗。