【发布时间】:2013-12-03 20:41:59
【问题描述】:
我正在使用 WebMatrix 查询 DB2 服务器。我认为快速、概念证明相关的任务会更容易……但至少可以说,使用 DB2 而不是它的内置提供程序一直是个挑战。
我知道我的结果会回来,因为我可以很好地遍历我的数据集并查看我的结果。
我正在尝试使用 WebMatrix 中的内置 WebGrid() 函数来显示我的结果并不断收到错误:
CS1502:最佳重载方法匹配 'System.Web.Helpers.WebGrid.WebGrid(System.Collections.Generic.IEnumerable, System.Collections.Generic.IEnumerable,字符串,int,bool, bool, string, string, string, string, string, string, string)' 有 一些无效的参数
我的代码基本上是:
OleDbConnection conn = new OleDbConnection(connString);
DataTable td = new DataTable;
OleDbDataAdapter da = new OleDbDataAdapter("SELECT USER, GROUP FROM DBO.TEST", connString);
ds = new DataSet();
da.Fill(ds);
var results = new WebGrid(ds.Tables[0].Rows);
当然,它失败了:
var results = new WebGrid(ds.Tables[0].Rows);
任何帮助或指导将不胜感激。我假设我需要将其转换为 System.Collections.Generic.IEnumerable,但不知道如何完成此操作...?
【问题讨论】: