Convert DbContext to Datatable in Code first entity framework

c# datatable dbcontext entity-framework linq-to-sql

Question

Greetings, I'm attempting to convert.DbContext cause toDataTable I possess one.class i.e. ClientTemplateModel which inheritsDbContext In this class, there is oneDbSet item, i.e.public virtual DbSet<imagecomment> ImageComments { get; set; } . Zzz-28-Zzz is what I'm utilizing.

This is my question.

using (ClientTemplateModel context = new ClientTemplateModel(connectionString))
{
  var result = context.ImageComments.Where(p => p.Dcn == dcn).OrderByDescending(p => p.CommentsDateTime);
}

I want to convert this here.result into DataTable . How can this be converted?

1
7
1/2/2015 6:26:09 AM

Accepted Answer

ZZZ_tmp
13
5/23/2017 11:46:11 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow