New Posts New Posts RSS Feed: Create Query...ufff
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Create Query...ufff

 Post Reply Post Reply
Author
master-of-disaster View Drop Down
Newbie
Newbie
Avatar

Joined: 12-Feb-2010
Location: Germany
Posts: 11
Post Options Post Options   Quote master-of-disaster Quote  Post ReplyReply Direct Link To This Post Topic: Create Query...ufff
    Posted: 08-May-2010 at 1:58am
Hello,
 
I'm a newbie in ideablade and SQL Database and so on.
Now I'm try to learn, create queries for different relation.
Most works fine.
 
But I try to read countrycode like in the following query in linq to sql, to solve the result with DevForce SL in my SL App.
Hier my Databasediagram to see my foreignkeys / relation uploads/682/Schema.zip
 
I've try following query, but I get no result.

public class MainPageViewModel

{

public MainPageViewModel()

{

TestNames = new ObservableCollection<TestName>();

var mgr = new TestEntities();

var query = mgr.TestNames.Include("TestOrders.TestCountries").Include("TestAdresses");

query.ExecuteAsync(op => op.Results.ForEach(TestNames.Add));

}

public ObservableCollection<TestName> TestNames { get; private set; }

}

When I try this, without "CountryCode" it works fine. I think, my problem is the relation between TestOrder * : 1 TestCountry. When I use an examples with relation 1 : * and not * : 1 Example: Include("Test.Test2") seems to work.
 
var query = mgr.TestNames.Include("TestOrders").Include("TestAdresses");
 
I think, Include is not the right way... What I've to do? Have any one an example to build a query with join?
When try to use join, I get an error by query.ExecuteAsync(op => op.Results.ForEach(TestNames.Add));
TestNames doens't match.
I don't find any comlex examples, is there anyone who can show me, what I do wrong?
 
Regards
Dirk
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down