I'm querying a DB2 server using WebMatrix. I figured it would be easier for quick, proof of concept related tasks... but using DB2 rather than its built-in providers has been challenge, to say the least.
I know my results are coming back since I can iterate thru my dataset just fine and see my results.
I'm trying to use the built-in WebGrid() function within WebMatrix to display my results and keep getting errors:
CS1502: The best overloaded method match for 'System.Web.Helpers.WebGrid.WebGrid(System.Collections.Generic.IEnumerable, System.Collections.Generic.IEnumerable, string, int, bool, bool, string, string, string, string, string, string, string)' has some invalid arguments
My code is basically:
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);
Of course, its failing on:
var results = new WebGrid(ds.Tables[0].Rows);
Any help or direction would be appreciated. I'm assuming I need to convert this to a System.Collections.Generic.IEnumerable, but no idea how to accomplish this...?