MULTIPLE DATASOURCE

Hi, 
I need to bind multiple tables of a database to a Sfdatagrid using dataclasses
I write code to execute a Linq join query but I can not view the result in the SfDatagrid
How can I do?

1 Reply

FP Farjana Parveen Ayubb Syncfusion Team July 21, 2014 12:40 PM UTC

Hi Daniele,

 

Thank you for contacting Syncfusion support.

 

We analyzed your query. You can achieve your requirement by using below code snippet

 

Please refer the following code snippet and sample in the following location:

 

Code Snippet:

DataTable dataTableSqlJoined = new DataTable();

           var result=from datarow1 in dataTable.AsEnumerable()

                     join

                     datarow2 in dataTable1.AsEnumerable()

                     on

                     datarow1.Field<int>("ID") equals datarow2.Field<int>("ID")

                     select

                     datarow1;

          DataTable dataTableLinqJoined = result.CopyToDataTable();

          DataSource = dataTableLinqJoined.DefaultView;

 

 

Regards,

Farjana Parveen A


Attachment: DataTable_Linq_Query_7caf265c.zip

Loader.
Up arrow icon