from and select in c# .net? -
possible duplicate:
from , select in c# .net?
can please tell me how specify particular column in select statement in following coding:
var combinedrows = dt1 in dsresults.tables[0].asenumerable() join dt2 in dsresults.tables[1].asenumerable() on dt1.field<string>("methodname") equals dt2.field<string>("methodname") select new { dt1, dt2 }; datatable finaldt = new datatable("finaltable"); finaldt.columns.add(new datacolumn("sp", typeof(string))); finaldt.columns.add(new datacolumn("method", typeof(string))); finaldt.columns.add(new datacolumn("class", typeof(string))); finaldt.columns.add(new datacolumn("bllmethod", typeof(string))); datarow newrow = finaldt.newrow(); foreach (var row in combinedrows) { datarow datarow = finaldt.newrow(); datarow.itemarray = row.dt1.itemarray; finaldt.rows.add(datarow); }
you refine select
statemenet:
select new { dt1.sp, dt1.method, dt1.class }
...etc
Comments
Post a Comment