c# - LINQ query returning no results -
i run following linq
query can see table of 2 columns, cannot see result in datagrid
can please tell me doing wrong?
database d = server.databases[cbodatabases.selecteditem.tostring()]; system.data.dataset ds = d.executewithresults("select * information_schema.columns"); datatable dt = ds.tables[0]; messagebox.show(dt.columns.count.tostring()); var query = data in dt.asenumerable()//asenumerable() select new { tablename = data[0], fieldname = data[1] }; datagridview1.datasource = query;
call tolist
on query, fetch results:
var query = data in dt.asenumerable()//asenumerable() select new { tablename = data[0], fieldname = data[1] }; datagridview1.datasource = query.tolist();
Comments
Post a Comment