<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Stored procedures with output parameters using SqlQuery in the DbContext API</title><link>http://blogs.msdn.com/b/diego/archive/2012/01/10/how-to-execute-stored-procedures-sqlquery-in-the-dbcontext-api.aspx</link><description>The DbContext API introduced in Entity Framework 4.1 exposes a few methods that provide pass-through access to execute database queries and commands in native SQL, such as Database.SqlQuery&amp;lt;T&amp;gt;, DbSet&amp;lt;T&amp;gt;.SqlQuery, and also Database.ExecuteSqlCommand</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Stored procedures with output parameters using SqlQuery in the DbContext API</title><link>http://blogs.msdn.com/b/diego/archive/2012/01/10/how-to-execute-stored-procedures-sqlquery-in-the-dbcontext-api.aspx#10348447</link><pubDate>Tue, 11 Sep 2012 23:20:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10348447</guid><dc:creator>Diego B Vega</dc:creator><description>&lt;p&gt;Crob, thanks for sharing this detail. I didn&amp;#39;t test this with different versions of SQL Server so I didn&amp;#39;t hit a problem with the missing EXEC. I will add a note to the post.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10348447" width="1" height="1"&gt;</description></item><item><title>re: Stored procedures with output parameters using SqlQuery in the DbContext API</title><link>http://blogs.msdn.com/b/diego/archive/2012/01/10/how-to-execute-stored-procedures-sqlquery-in-the-dbcontext-api.aspx#10348337</link><pubDate>Tue, 11 Sep 2012 19:13:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10348337</guid><dc:creator>Crob</dc:creator><description>&lt;p&gt;Found the solution here:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://stackoverflow.com/questions/6403930/what-causes-incorrect-syntax-near-stored-procedure-name-in-ef-code-first-and"&gt;stackoverflow.com/.../what-causes-incorrect-syntax-near-stored-procedure-name-in-ef-code-first-and&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10348337" width="1" height="1"&gt;</description></item><item><title>re: Stored procedures with output parameters using SqlQuery in the DbContext API</title><link>http://blogs.msdn.com/b/diego/archive/2012/01/10/how-to-execute-stored-procedures-sqlquery-in-the-dbcontext-api.aspx#10348315</link><pubDate>Tue, 11 Sep 2012 18:13:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10348315</guid><dc:creator>Crob</dc:creator><description>&lt;p&gt;I am using this against a sql2008 server and it&amp;#39;s working great for me. &amp;nbsp;I need to get the application to work against a sql2000 server but when I try it I get the exception &amp;quot;Incorrect syntax near &amp;#39;stored procedure name here&amp;#39;.&amp;quot; &amp;nbsp;If I build the query string myself without using parameters it goes through fine like below:&lt;/p&gt;
&lt;p&gt;var spResults = context.Database.SqlQuery&amp;lt;GoldmineCustomerInfo&amp;gt;(&amp;quot;spweb20_GetCustomerInfoFromGoldMine @custCode = &amp;#39;custcodevalue&amp;#39;).ToList();&lt;/p&gt;
&lt;p&gt;Do I have to tell EF this is a sql2000 server in my configuration somewhere?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10348315" width="1" height="1"&gt;</description></item><item><title>re: Stored procedures with output parameters using SqlQuery in the DbContext API</title><link>http://blogs.msdn.com/b/diego/archive/2012/01/10/how-to-execute-stored-procedures-sqlquery-in-the-dbcontext-api.aspx#10309283</link><pubDate>Wed, 23 May 2012 04:39:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10309283</guid><dc:creator>Diego B Vega</dc:creator><description>&lt;p&gt;@Nadeem: If you are refering to doing eager loading with SqlQuery, we don&amp;#39;t have plans to support that. You can use lazy loading with entities materialized using SqlQuery though. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10309283" width="1" height="1"&gt;</description></item><item><title>re: Stored procedures with output parameters using SqlQuery in the DbContext API</title><link>http://blogs.msdn.com/b/diego/archive/2012/01/10/how-to-execute-stored-procedures-sqlquery-in-the-dbcontext-api.aspx#10309281</link><pubDate>Wed, 23 May 2012 04:28:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10309281</guid><dc:creator>Nadeem</dc:creator><description>&lt;p&gt;Does EF 5 SqlQuery materialize related entities or is it not supported yet ?!!&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10309281" width="1" height="1"&gt;</description></item><item><title>re: Stored procedures with output parameters using SqlQuery in the DbContext API</title><link>http://blogs.msdn.com/b/diego/archive/2012/01/10/how-to-execute-stored-procedures-sqlquery-in-the-dbcontext-api.aspx#10257942</link><pubDate>Wed, 18 Jan 2012 06:59:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10257942</guid><dc:creator>Diego B Vega</dc:creator><description>&lt;p&gt;Jimi, I have just sent an answer to the question you posted in StackOverflow at &lt;a rel="nofollow" target="_new" href="http://stackoverflow.com/questions/8905746/poco-sqlquery-using-entity-framework-4-1-oracle-sp-with-ref-cursor-output-pa/8906234#8906234"&gt;stackoverflow.com/.../8906234&lt;/a&gt;. I am not familiar with how this part of the Oracle provider works but if ref curors can be bound as DbParameters I think it should be possible to make them work with this SqlQuery and ExecuteSqlCommand. I have also forwarded your question to some folks hoping they will be able to help you.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10257942" width="1" height="1"&gt;</description></item><item><title>re: Stored procedures with output parameters using SqlQuery in the DbContext API</title><link>http://blogs.msdn.com/b/diego/archive/2012/01/10/how-to-execute-stored-procedures-sqlquery-in-the-dbcontext-api.aspx#10257923</link><pubDate>Wed, 18 Jan 2012 06:01:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10257923</guid><dc:creator>Jimi</dc:creator><description>&lt;p&gt;Any idea whether this would work with an Oracle 11g database (in particular, a SP returning a refcursor), or is this purely MSSQL at the moment?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10257923" width="1" height="1"&gt;</description></item></channel></rss>