Print Page | Close Window

Fatching Data To Multiple Database Table

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2589
Printed Date: 28-Apr-2025 at 12:16am


Topic: Fatching Data To Multiple Database Table
Posted By: AnupTrivedi
Subject: Fatching Data To Multiple Database Table
Date Posted: 29-Mar-2011 at 5:45am
 Two table name is Contact_master and Vendore_master ,i am used join Query To get output the two table .Please Help Me.



Replies:
Posted By: sbelini
Date Posted: 29-Mar-2011 at 10:28am
Hi AnupTrivedi,
 
I believe what you are looking for is a projection.
i.e. (example against NorthwindIB)
 
[TestMethod]
public void TestProjection() {
  var mgr = new NorthwindIBEntities();
  var query = mgr.Customers.Where(c => c.Country == "USA")
    .Select(e => new { employee = e,
      orders = e.Orders.Where(o => o.OrderDate > new DateTime(1995, 1, 1))
    });
var results = query.Execute();
}
 
Regards,
   Silvio.


Posted By: AnupTrivedi
Date Posted: 30-Mar-2011 at 4:26am
But Data Not Show In grid 


Posted By: sbelini
Date Posted: 30-Mar-2011 at 9:06am
Hi AnupTrivedi,
 
Is this a Silverlight app? If yes, that's because anonymous types cannot be bound to the Silverlight DataGrid.
However, DevForce supports binding to anonymous types by using the DynamicTypeConverter (IdeaBlade.Core.DynamicTypeConverter)

i.e.
dataGrid1.ItemsSource = DynamicTypeConverter.Convert(args.Results);
If not, please be clear and provide detailed information on what exactly you are trying to accomplish.
 
Silvio.



Print Page | Close Window