How to create datagrid columns from multiple records using LinqtoSql?

Total Post:183

Points:1285

 1089  View(s)
Ratings:
Rate this:

I have a sql table and I want each record to be a datagrid column and another sql table with multiple records related to each fieldID.

I would like to display each value in the appropiate column of a datagrid using linq.

  1. Re: How to create datagrid columns from multiple records using LinqtoSql?

    Hi Ankita, 


    var dc = new YourdataContext();
        yourGrid.DataSource = dc.YourTable.Select( t => new {                                                      t.Property1,                                                     t.RelationTable.Property2,                                                     etc...                    
                                                      } );
       yourGrid.DataBind();

    and add this in the page_load or page_init

      Modified On Apr-04-2018 07:02:35 AM

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.