<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Create Query...ufff</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Create Query...ufff</description>
  <pubDate>Mon, 13 Apr 2026 05:26:28 -700</pubDate>
  <lastBuildDate>Sat, 08 May 2010 01:58:31 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=1798</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Create Query...ufff : Hello,  I&amp;#039;m a newbie in...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1798&amp;PID=6830#6830</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=682" rel="nofollow">master-of-disaster</a><br /><strong>Subject:</strong> 1798<br /><strong>Posted:</strong> 08-May-2010 at 1:58am<br /><br /><FONT face="Arial, Helvetica, sans-serif">Hello,</FONT><DIV>&nbsp;</DIV><DIV><FONT face="Arial, Helvetica, sans-serif">I'm a newbie in ideablade and SQL Database and so on.</FONT></DIV><DIV><FONT face="Arial, Helvetica, sans-serif">Now I'm try to learn, create queries for different relation.</FONT></DIV><DIV><FONT face="Arial, Helvetica, sans-serif">Most works fine.</FONT></DIV><DIV><FONT face="Arial, Helvetica, sans-serif"></FONT>&nbsp;</DIV><DIV><FONT face="Arial, Helvetica, sans-serif">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.</FONT></DIV><DIV><DIV><FONT face="Arial, Helvetica, sans-serif">Hier my Databasediagram to see my foreignkeys / relation </FONT><a href="http://www.ideablade.com/forum/uploads/682/Schema.zip" target="_blank"><FONT face="Arial, Helvetica, sans-serif">uploads/682/Schema.zip</FONT></A></DIV><DIV><FONT face="Arial, Helvetica, sans-serif"></FONT>&nbsp;</DIV></DIV><DIV><FONT face="Arial, Helvetica, sans-serif">I've try following query, but I get no result.</FONT></DIV><DIV><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><P>public</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>class</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>MainPageViewModel</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P>{</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>public</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> MainPageViewModel()</P><P>{</P><P>TestNames = </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>new</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>ObservableCollection</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>TestName</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt;();</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> mgr = </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>new</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>TestEntities</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>();</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> query = mgr.TestNames.Include(</FONT></FONT><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas>"TestOrders.TestCountries"</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>).Include(</FONT></FONT><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas>"TestAdresses"</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>);</P><P>query.ExecuteAsync(op =&gt; op.Results.ForEach(TestNames.Add));</P><P></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>}</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>public</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>ObservableCollection</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>TestName</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt; TestNames { </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>get</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>; </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>private</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>set</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>; }</P><P>}</P></FONT></FONT></DIV><DIV><FONT face="Arial, Helvetica, sans-serif">When I try this, without "CountryCode" it works fine. I think, my problem is the relation between TestOrder&nbsp;*&nbsp;:&nbsp;1 TestCountry. When I use an examples with relation 1 : * and not * : 1 Example: Include("Test.Test2") seems to work.</FONT></DIV><DIV>&nbsp;</DIV><DIV><FONT size=2><FONT face=C&#111;nsolas><FONT color=#0000ff>var</FONT> query = mgr.TestNames.Include(<FONT color=#a31515><FONT color=#a31515><FONT color=#a31515>"TestOrders"</FONT></FONT></FONT>).Include(<FONT color=#a31515><FONT color=#a31515><FONT color=#a31515>"TestAdresses"</FONT></FONT></FONT>);</FONT></FONT></DIV><DIV><FONT size=2 face=C&#111;nsolas></FONT>&nbsp;</DIV><DIV><FONT size=2 face="Arial, Helvetica, sans-serif">I think, Include is not the right way... What I've to do? Have any one an example to build a query with join?</FONT></DIV><DIV><FONT size=2 face="Arial, Helvetica, sans-serif">When try to use join,&nbsp;I get an error by&nbsp;query.ExecuteAsync(op =&gt; op.Results.ForEach(TestNames.Add));</FONT></DIV><DIV><FONT size=2 face="Arial, Helvetica, sans-serif">TestNames doens't match.</FONT></DIV><DIV><FONT face="Arial, Helvetica, sans-serif">I don't find any comlex examples, is there anyone who can show me, what I do wrong?</FONT></DIV><DIV>&nbsp;</DIV><DIV>Regards </DIV><DIV>Dirk</DIV>]]>
   </description>
   <pubDate>Sat, 08 May 2010 01:58:31 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1798&amp;PID=6830#6830</guid>
  </item> 
 </channel>
</rss>