<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: LINQ to SQL: a three-month checkpoint</title>
	<link>http://jonkruger.com/blog/2008/01/19/linq-to-sql-a-three-month-checkpoint/</link>
	<description>Works on my machine</description>
	<pubDate>Sun, 07 Sep 2008 16:50:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1</generator>

	<item>
		<title>By: dominique</title>
		<link>http://jonkruger.com/blog/2008/01/19/linq-to-sql-a-three-month-checkpoint/#comment-2824</link>
		<author>dominique</author>
		<pubDate>Fri, 01 Feb 2008 18:52:42 +0000</pubDate>
		<guid>http://jonkruger.com/blog/2008/01/19/linq-to-sql-a-three-month-checkpoint/#comment-2824</guid>
					<description>Hi,

How can you obtain the SQL generated code by Linq ?

Perharps it is obvious but .. I am new with Linq to SQL.

Cheers

Dominique</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>How can you obtain the SQL generated code by Linq ?</p>
<p>Perharps it is obvious but .. I am new with Linq to SQL.</p>
<p>Cheers</p>
<p>Dominique</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Jon Kruger</title>
		<link>http://jonkruger.com/blog/2008/01/19/linq-to-sql-a-three-month-checkpoint/#comment-2828</link>
		<author>Jon Kruger</author>
		<pubDate>Sun, 03 Feb 2008 22:01:57 +0000</pubDate>
		<guid>http://jonkruger.com/blog/2008/01/19/linq-to-sql-a-three-month-checkpoint/#comment-2828</guid>
					<description>Dominique - 

Check out this &lt;a href="http://www.u2u.info/Blogs/Kris/Lists/Posts/Post.aspx?ID=11" rel="nofollow"&gt;post&lt;/a&gt; on how you can have all of the SQL executed by LINQ to SQL in the output window in Visual Studio.  This is what I do on my project and it works great.

&lt;a href="http://www.linqpad.net/" rel="nofollow"&gt;LINQPad&lt;/a&gt; is also a handy tool for this sort of thing... think of it as a lightweight version of SQL Server Management Studio for LINQ to SQL.</description>
		<content:encoded><![CDATA[<p>Dominique - </p>
<p>Check out this <a href="http://www.u2u.info/Blogs/Kris/Lists/Posts/Post.aspx?ID=11" rel="nofollow">post</a> on how you can have all of the SQL executed by LINQ to SQL in the output window in Visual Studio.  This is what I do on my project and it works great.</p>
<p><a href="http://www.linqpad.net/" rel="nofollow">LINQPad</a> is also a handy tool for this sort of thing&#8230; think of it as a lightweight version of SQL Server Management Studio for LINQ to SQL.</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: dominique</title>
		<link>http://jonkruger.com/blog/2008/01/19/linq-to-sql-a-three-month-checkpoint/#comment-2830</link>
		<author>dominique</author>
		<pubDate>Mon, 04 Feb 2008 21:19:57 +0000</pubDate>
		<guid>http://jonkruger.com/blog/2008/01/19/linq-to-sql-a-three-month-checkpoint/#comment-2830</guid>
					<description>Thanks Jon, I tried the code in your link, I translated it to VB and it is fine.

In MSDN Library, I found 2 another solutions (easier) :

   Dim db As New NorthwindDataContext

   Console.WriteLine("solution 2 : msdn")
   db.Log = Console.Out

   Dim q = From c In db.Customers _
               From o In db.Orders() _
               Where (c.CustomerID = o.CustomerID) _
                          And c.Country = "France" _
               Order By c.CustomerID _
               Select o.OrderID, o.ShipCity, c.CustomerID

   DataGridView1.DataSource = q

   Console.WriteLine("solution 3 : msdn")
   Dim dc As Common.DbCommand = db.GetCommand(q)
   Console.WriteLine(vbNewLine &#38; "Command Text: " &#38; vbNewLine &#38; dc.CommandText)

These 3 solutions run only with Linq (use db.Log).

The syntax of the second solution seems strange to me :
   db.Log = Console.Out
In fact, we send to the console the result of the log of db, I think that :
   Console.Out = db.Log
would be more logical 

I think it is also possible to do that with SQL Profiler but I don't know how to use it.</description>
		<content:encoded><![CDATA[<p>Thanks Jon, I tried the code in your link, I translated it to VB and it is fine.</p>
<p>In MSDN Library, I found 2 another solutions (easier) :</p>
<p>   Dim db As New NorthwindDataContext</p>
<p>   Console.WriteLine(&#8221;solution 2 : msdn&#8221;)<br />
   db.Log = Console.Out</p>
<p>   Dim q = From c In db.Customers _<br />
               From o In db.Orders() _<br />
               Where (c.CustomerID = o.CustomerID) _<br />
                          And c.Country = &#8220;France&#8221; _<br />
               Order By c.CustomerID _<br />
               Select o.OrderID, o.ShipCity, c.CustomerID</p>
<p>   DataGridView1.DataSource = q</p>
<p>   Console.WriteLine(&#8221;solution 3 : msdn&#8221;)<br />
   Dim dc As Common.DbCommand = db.GetCommand(q)<br />
   Console.WriteLine(vbNewLine &amp; &#8220;Command Text: &#8221; &amp; vbNewLine &amp; dc.CommandText)</p>
<p>These 3 solutions run only with Linq (use db.Log).</p>
<p>The syntax of the second solution seems strange to me :<br />
   db.Log = Console.Out<br />
In fact, we send to the console the result of the log of db, I think that :<br />
   Console.Out = db.Log<br />
would be more logical </p>
<p>I think it is also possible to do that with SQL Profiler but I don&#8217;t know how to use it.</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Ahtesham</title>
		<link>http://jonkruger.com/blog/2008/01/19/linq-to-sql-a-three-month-checkpoint/#comment-3006</link>
		<author>Ahtesham</author>
		<pubDate>Thu, 22 May 2008 07:07:19 +0000</pubDate>
		<guid>http://jonkruger.com/blog/2008/01/19/linq-to-sql-a-three-month-checkpoint/#comment-3006</guid>
					<description>I am using linq 2 sql store procedures . I didn’t change the return type of any store procedure so it is returning isingleResult
I make a class ”mydataconetcion” which use the datacontext class object and I am getting all store procedures in that class by 
Datacontext db=new datacontext();
One example of my store procedure is 
public ISingleResult getCategoryManufecturer(int catId)
{
ISingleResult CategoryManufecture = db.dashCommerce_Store_FetchCategoryManufacturers(catId);
return CategoryManufecture;
}
 In my web pages I make object of mydataconetcion class 
Mydataconetcion dc=new mydataconetcion();
I am storing the result  in var then by foreach I am traversing it . or I simply bind it to my gridview and repetors and so on .
I am doin this 
Var selectedProduct =dc. getCategoryManufecturer(7);
CatGridview.datasource= selectedProduct;

It works fine but now I want something like this 
If (selectedProduct!=null )
{
CatGridview.visible=true;
CatGridview.datasource= selectedProduct;

}
Or empty or what ever condition that tell me that there is any value in  selectedProduct
So help me out on this how can I make sure that there is any value or not</description>
		<content:encoded><![CDATA[<p>I am using linq 2 sql store procedures . I didn’t change the return type of any store procedure so it is returning isingleResult<br />
I make a class ”mydataconetcion” which use the datacontext class object and I am getting all store procedures in that class by<br />
Datacontext db=new datacontext();<br />
One example of my store procedure is<br />
public ISingleResult getCategoryManufecturer(int catId)<br />
{<br />
ISingleResult CategoryManufecture = db.dashCommerce_Store_FetchCategoryManufacturers(catId);<br />
return CategoryManufecture;<br />
}<br />
 In my web pages I make object of mydataconetcion class<br />
Mydataconetcion dc=new mydataconetcion();<br />
I am storing the result  in var then by foreach I am traversing it . or I simply bind it to my gridview and repetors and so on .<br />
I am doin this<br />
Var selectedProduct =dc. getCategoryManufecturer(7);<br />
CatGridview.datasource= selectedProduct;</p>
<p>It works fine but now I want something like this<br />
If (selectedProduct!=null )<br />
{<br />
CatGridview.visible=true;<br />
CatGridview.datasource= selectedProduct;</p>
<p>}<br />
Or empty or what ever condition that tell me that there is any value in  selectedProduct<br />
So help me out on this how can I make sure that there is any value or not</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Jon</title>
		<link>http://jonkruger.com/blog/2008/01/19/linq-to-sql-a-three-month-checkpoint/#comment-3018</link>
		<author>Jon</author>
		<pubDate>Tue, 03 Jun 2008 22:26:38 +0000</pubDate>
		<guid>http://jonkruger.com/blog/2008/01/19/linq-to-sql-a-three-month-checkpoint/#comment-3018</guid>
					<description>This post was written a while ago, so hopefully you already know this, but you can use SQL Metal (a command line tool that comes with VS 2008 and that I think the LINQ to SQL visual designer uses under the covers) to generate your class files and/or mapping files.  If you need to generate classes for a database with a  large number of tables it is MUCH easier and faster than dragging all the tables onto the visual designer (IMO).</description>
		<content:encoded><![CDATA[<p>This post was written a while ago, so hopefully you already know this, but you can use SQL Metal (a command line tool that comes with VS 2008 and that I think the LINQ to SQL visual designer uses under the covers) to generate your class files and/or mapping files.  If you need to generate classes for a database with a  large number of tables it is MUCH easier and faster than dragging all the tables onto the visual designer (IMO).</p>
]]></content:encoded>
				</item>
</channel>
</rss>
