<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>All About Data</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/bindeshv/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/bindeshv/feed.xml</link>
    <description />
    <lastBuildDate>Tue, 16 Apr 2019 05:48:58 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>EF query execution pattern. Usage of sp_executesql vs direct execution of sql statement</title>
      <link>https://docs.microsoft.com/archive/blogs/bindeshv/ef-query-execution-pattern-usage-of-sp_executesql-vs-direct-execution-of-sql-statement</link>
      <pubDate>Mon, 12 Jul 2010 23:23:00 GMT</pubDate>
      <dc:creator><![CDATA[Bindesh Vijayan-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bindeshv/2010/07/12/ef-query-execution-pattern-usage-of-sp_executesql-vs-direct-execution-of-sql-statement/</guid>
      <description><![CDATA[This was posted in an internal discussion. The question was that it was observed that sometimes in...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: trebuchet ms,geneva;"><span style="font-size: small;">This was posted in an internal discussion. The question was that it was observed that sometimes in the generated sql it appeared that EF was very decisive between directly executing the query and sometimes using sp_executesql.</span></span></p>
<p><span style="font-family: Trebuchet MS;"><span style="font-family: trebuchet ms,geneva;"><span style="font-size: x-small;"><span style="font-family: trebuchet ms,geneva;"><span style="font-size: small;">Before I go ahead and explain this behavior a little background on sp_executesql. The sp_executesql comes into play when there is a client side parameterization helping in the re-use of one parameterized compiled plan. More information about Query Parameterization </span></span></span></span><a href="http://blogs.msdn.com/b/sqlprogrammability/archive/2007/01/11/4-0-query-parameterization.aspx"><span style="font-family: trebuchet ms,geneva;"><span style="font-size: x-small;"><span style="font-family: trebuchet ms,geneva;"><span style="font-size: small;">here</span></span></span></span></a><span style="font-family: trebuchet ms,geneva;"><span style="font-size: x-small;"><span style="font-family: trebuchet ms,geneva;"><span style="font-size: small;"> . When there is no parameter specified then SQL Server tries to do an auto parameterization helping in reuse of query plan.</span></span></span></span></span></p>
<p><span style="font-family: trebuchet ms,geneva;"><span style="font-size: x-small;"><span style="font-family: trebuchet ms,geneva;"><span style="font-size: small;">It appears that the decision to use sp_executesql or a direct sql batch is governed by ADO.Net&rsquo;s SQLCommand object. It appears per the Tabular Data Stream (TDS) there&rsquo;s only 2 ways to execute a SQL query &ndash; use RPC to execute SQL stored procedure and use SQL Batch for T-SQL. So when we have a parameterized query we tend to use RPC and call sp_executesql. </span></span></span></span></p>
<p><span style="font-family: trebuchet ms,geneva;"><span style="font-size: x-small;"><span style="font-family: trebuchet ms,geneva;"><span style="font-size: small;">Now coming back to Entity Framework. A query like this </span></span></span></span></p>
<p><span style="font-family: trebuchet ms,geneva;"><span style="font-size: x-small;"><span style="font-family: trebuchet ms,geneva;"><span style="font-size: small;">
<pre class="scroll"><code class="csharp">var cust = from c in ctx.Customers
<br />           where c.CustomerID == "ALFKI"
<br />           select c;</code></pre>
</span></span></span></span></p>
<p><span style="font-family: Trebuchet MS;"><span style="font-size: small;">would produce the following T-SQL</span></span></p>
<p><span style="font-family: Trebuchet MS;"><span style="font-size: small;">
<pre class="scroll"><code class="mysql">SELECT 
<br />[Extent1].[CustomerID] AS [CustomerID], 
<br />[Extent1].[CompanyName] AS [CompanyName], 
<br />[Extent1].[ContactName] AS [ContactName], 
<br />[Extent1].[ContactTitle] AS [ContactTitle], 
<br />[Extent1].[Address] AS [Address], 
<br />[Extent1].[City] AS [City], 
<br />[Extent1].[Region] AS [Region], 
<br />[Extent1].[PostalCode] AS [PostalCode], 
<br />[Extent1].[Country] AS [Country], 
<br />[Extent1].[Phone] AS [Phone], 
<br />[Extent1].[Fax] AS [Fax]
<br />FROM [dbo].[Customers] AS [Extent1]
<br />WHERE N'ALFKI' = [Extent1].[CustomerID]
</code></pre>
<pre class="scroll"><span style="font-size: small;"><span style="font-family: trebuchet ms,geneva;">This is so because we have a constant value for the parameter will not change and hence there is a direct SQLBatch generated. <br />Note that at the SQL Server end this will get converted into an auto parameterized query. </span></span></pre>
</span></span><span style="font-size: small;"><span style="font-family: trebuchet ms,geneva;"></span></span></p>
<pre class="csharpcode"><span style="font-size: small;"><span style="font-family: trebuchet ms,geneva;"><span style="font-size: x-small;"><span style="font-family: trebuchet ms,geneva;"><span style="font-size: x-small;"><span style="font-family: trebuchet ms,geneva;"><span style="font-size: small;">However, a query like this </span></span></span></span></span></span></span></pre>
<pre class="csharpcode"><span style="font-size: small;"><span style="font-family: trebuchet ms,geneva;"><span style="font-size: x-small;"><span style="font-family: trebuchet ms,geneva;"><span style="font-size: x-small;"><span style="font-family: trebuchet ms,geneva;"><span style="font-size: small;"><pre class="scroll"><code class="csharp">string CustID = "ALFKI";
<br />                var cust = from c in ctx.Customers
<br />                           where c.CustomerID == CustID
<br />                           select c;
<br /></code></pre>
</span></span></span></span></span></span></span></pre>
<p>&nbsp;<span style="font-family: trebuchet ms,geneva;"><span style="font-size: small;">Would generate the following query </span></span></p>
<p><span style="font-family: trebuchet ms,geneva;"><span style="font-size: small;">
<pre class="scroll"><code class="csharp">exec sp_executesql N'SELECT 
<br />[Extent1].[CustomerID] AS [CustomerID], 
<br />[Extent1].[CompanyName] AS [CompanyName], 
<br />[Extent1].[ContactName] AS [ContactName], 
<br />[Extent1].[ContactTitle] AS [ContactTitle], 
<br />[Extent1].[Address] AS [Address], 
<br />[Extent1].[City] AS [City], 
<br />[Extent1].[Region] AS [Region], 
<br />[Extent1].[PostalCode] AS [PostalCode], 
<br />[Extent1].[Country] AS [Country], 
<br />[Extent1].[Phone] AS [Phone], 
<br />[Extent1].[Fax] AS [Fax]
<br />FROM [dbo].[Customers] AS [Extent1]
<br />WHERE [Extent1].[CustomerID] = @p__linq__0',N'@p__linq__0 nvarchar(4000)',@p__linq__0=N'ALFKI'
</code></pre>
<pre class="scroll"></pre>
</span></span><span style="font-size: small;"><span style="font-family: trebuchet ms,geneva;">This is so because we have a variable and the value can get changed and hence a dynamic behavior and the use of a stored proc that allows us to change the parameter<br />value on each successive run </span></span></p>
<p>

</p>]]></content:encoded>
    </item>
    <item>
      <title>ObjectSet&lt;T&gt; vs ObjectQuery&lt;T&gt; in Entity Framework v 4</title>
      <link>https://docs.microsoft.com/archive/blogs/bindeshv/objectsett-vs-objectqueryt-in-entity-framework-v-4</link>
      <pubDate>Tue, 06 Jul 2010 02:36:00 GMT</pubDate>
      <dc:creator><![CDATA[Bindesh Vijayan-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bindeshv/2010/07/06/objectsett-vs-objectqueryt-in-entity-framework-v-4/</guid>
      <description><![CDATA[I was a little curious about this change in EFv4 and wanted to understand why this was done. So here...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: Trebuchet MS;">I was a little curious about this change in EFv4 and wanted to understand why this was done. So here is what I was able to understand </span></p>
<p><span style="font-family: Trebuchet MS;"><strong>Background</strong></span></p>
<p><span style="font-family: Trebuchet MS;">Lets take a look at the following code for querying the EntitySet in EF v3.5</span></p>
<p><span style="font-family: Trebuchet MS;">
<pre class="scroll"><code class="csharp"> using (NorthwindEntities ex = new NorthwindEntities())
<br />            {
<br />                var cus = ex.Customers;
<br />                foreach (var c in cus)
<br />                {
<br />                    //do some operation here             
<br />                }
<br />            }</code></pre>
</span></p>
<p><span style="font-family: Trebuchet MS;"></span></p>
<div class="csharpcode"><span style="font-family: Trebuchet MS;">If you put a break point inside the foreach block and try to inspect the cus type you will see the following type listed in EF v3.5 </span></div>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/68/23/metablogapi/8244.file_4577B17A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-23-metablogapi/8244.file_5F00_4577B17A.png"><img height="143" width="689" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/68/23/metablogapi/6082.file_thumb_5BEA5001.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-23-metablogapi/6082.file_5F00_thumb_5F00_5BEA5001.png" alt="file" border="0" title="file" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a> </p>
<p><span style="font-family: Trebuchet MS;">As you see here the type resolved is ObjectQuery&lt;NorthwindModel.Customers&gt;. And the major design hit was that if you were to do some CUD(Create,Update and Delete) operation in the pre EF v4 world, you had to depend upon ObjectContext rather than perfoming them on the Object itself. So we had to write the following code for the Create operation </span></p>
<p><span style="font-family: Trebuchet MS;"><strong>
<pre class="scroll"><code class="csharp">//create a new customer      
<br />Customers newCustomer = new Customers();    
<br /> newCustomer.ContactName = "Xyz";       
<br /> //fill the rest details of the customer
<br /> //...   
<br />//add the new customer to the context  
<br /> ex.AddToCustomers(newCustomer); 
<br />//persist changes 
<br /> ex.SaveChanges();
<br /> 
<br />
<br /></code></pre>
</strong></span></p>
<p><span style="font-family: Trebuchet MS;"><strong>Outcome</strong></span></p>
<p><span style="font-family: Trebuchet MS;">In EFv4, ObjectSet was introduced. ObjectSet is an extension to ObjectQuery and has the following graph of inheritance</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/68/23/metablogapi/2772.ObjectSetClass_63B242A3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-23-metablogapi/2772.ObjectSetClass_5F00_63B242A3.png"><img height="359" width="659" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/68/23/metablogapi/4786.ObjectSetClass_thumb_67DC1A68.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-68-23-metablogapi/4786.ObjectSetClass_5F00_thumb_5F00_67DC1A68.png" alt="ObjectSetClass" border="0" title="ObjectSetClass" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /></a>&nbsp;</p>
<p><span style="font-family: Trebuchet MS;">This gives power to the EntitySet to do the&nbsp; CUD operations that were only available in the ObjectContext before. So now the above code for adding a Customer entity will look like this </span></p>
<div class="csharpcode">
<pre class="scroll"><code class="csharp"> using (NorthwindEntities ex = new NorthwindEntities())            
<br /> {              
<br /> Customer newCustomer = new Customer();
<br /> newCustomer.ContactName = "Xyz";       
<br /> ex.Customers.AddObject(newCustomer);  
<br /> ex.SaveChanges();       
<br /> }</code></pre>
</div>
<p>

</p>
<p><span style="font-family: Trebuchet MS;">&nbsp;</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Displaying WCF Data Service data in local reports</title>
      <link>https://docs.microsoft.com/archive/blogs/bindeshv/displaying-wcf-data-service-data-in-local-reports</link>
      <pubDate>Fri, 20 Nov 2009 22:30:42 GMT</pubDate>
      <dc:creator><![CDATA[Bindesh Vijayan-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bindeshv/2009/11/20/displaying-wcf-data-service-data-in-local-reports/</guid>
      <description><![CDATA[Its been sometime that I have blogged. I recently got asked by one of my peers on how to display the...]]></description>
      <content:encoded><![CDATA[<p><font size="2" face="ver">Its been sometime that I have blogged. I recently got asked by one of my peers on how to display the data from DataService on a local report and how to pass a parameter . </font></p>  <p><font size="2" face="ver">Its relatively easy to do this , the steps would be </font></p>  <ul>   <li><font size="2" face="ver">Make a connection to the DataService using Data Service client API </font></li>    <li><font size="2" face="ver">Get the Data as a collection , my favorite List&lt;T&gt; :) </font></li>    <li><font size="2" face="ver">Add it to the ReportDataSource and bind it to the LocalReport</font> </li> </ul>  <p><font size="2" face="ver">However, regarding the parameter passing , we know that if we add a parameter to the local report it does not prompt for the user and the developer is responsible for getting the value. Also you need to decide whether you need to get the entire data on the client and then do a filter on it or if&#160; you want to get the filtered data from the server based on the parameter selected from the client. I took the former approach and get the entire data(considering the small amount of data that I have ). Here is how </font></p>  <p>I am assuming that you already have a neat WCF Data Service defined and ready to take the requests, in this case at <a title="http://localhost:54560/MyDataService/NorthwindService.svc/" href="http://localhost:54560/MyDataService/NorthwindService.svc/">http://localhost:54560/MyDataService/NorthwindService.svc/</a> . If you are new to this then I suggest you take a look at <a href="http://msdn.microsoft.com/en-us/data/cc668810.aspx">Getting Started with Data Services</a> section on MSDN</p>  <p>&#160;</p>  <p>In order to code the client lets first create a Data Service proxy using the tool DataSvcUtil.exe . Open up Visual Studio command prompt and type the following </p>  <p>c:\Users\bindeshv&gt;DataSvcUtil /out:NorthwindService.cs /language:CSharp /uri:http://localhost:54560/MyDataService/NorthwindService.svc/</p>  <p>&#160;</p>  <p>Next go ahead and add this to your WinForms project as an existing item. Once done you need to add the Using reference to the newly added chsarp namespace.</p>  <p>&#160;</p>  <p>Add a RDLC file to the project as shown below </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_4.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_1.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_1.png" width="807" height="488" /></a> </p>  <p>Next we need to define the data source for the local report. In order to do that bring up the Data Sources explore (from Visual Studio Menu , Data &gt; Show Data Sources) and then click on Add New Data Source in the Data Source Explorer. This will start a wizard and in the first window choose Service as the Data Source type and in the next window type in the url of your WCF Data Service as shown below and click Go </p>  <p>&#160;</p>  <p>&#160;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_6.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_6.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_2.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_2.png" width="625" height="508" /></a> </p>  <p>Go ahead and give a namespace and then click on OK button.&#160; Once the service reference is added to the project and since WCF Data Services exposes entity you need to choose the object that you will bind the report to. In order to do this again go to the Data Source Explorer and then Add a new Data Source but this time choose Object instead of service and point it to the WCF Service that was added to the project like shown below </p>  <p>&#160;</p>  <p></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_8.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_8.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_3.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_3.png" width="655" height="508" /></a> </p>  <p>Once the object is added to the Data Source Explore you can proceed with the normal design of the report by dragging in a table component and then adding the necessary fields </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_10.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_10.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_4.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_4.png" width="260" height="338" /></a> </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_12.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_12.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_5.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_5.png" width="634" height="220" /></a> </p>  <p></p>  <p></p>  <p>Now we need to add the Report Parameter, in this case I will specify the Employee ID as input for filtering , so that we see details of only one specific employee. In the Visual Studio Menu option go ahead and chose <strong>Report &gt; Report Parameters..&#160; </strong>and the required parameter </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_14.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_14.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_6.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_6.png" width="827" height="618" /></a> </p>  <p>Once the parameter is defined you need to specify it in the Reports Table Properties Filter section as shown below </p>  <p>&#160;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_18.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_18.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_8.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_8.png" width="644" height="541" /></a> </p>  <p>Once the filtering is done go ahead and add a Report Viewer control to the form. Remember we need to device our own parameter for Reports in case of local report. Here is how my form looks after the design is done </p>  <p>&#160;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_20.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_20.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_9.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_9.png" width="748" height="421" /></a> </p>  <p>And here is how the code behind looks like </p>  <p>&#160;</p>  <pre class="code"><span style="color: green">     <font size="2" face="Lucida Console">  //Form level member
       </font></span><font size="2"><font face="Lucida Console"><span style="color: blue">private </span><span style="color: #2b91af">List</span>&lt;<span style="color: #2b91af">Employees</span>&gt; empList = <span style="color: blue">null </span>;</font></font></pre>

<pre class="code"><font size="2"><font face="Lucida Console"><span style="color: blue">       private void </span>Form1_Load(<span style="color: blue">object </span>sender, <span style="color: #2b91af">EventArgs </span>e)
        {
            <span style="color: blue">if </span>(empList == <span style="color: blue">null</span>)
            {

                NorthwindModel.<span style="color: #2b91af">NorthwindEntities </span>entitiesContext = <span style="color: blue">new </span>NorthwindModel.<span style="color: #2b91af">NorthwindEntities</span>(<span style="color: blue">new </span><span style="color: #2b91af">Uri</span>(<span style="color: #a31515">&quot;http://localhost:54560/MyDataService/NorthwindService.svc/&quot;</span>));
                </font></font><font size="2"><font face="Lucida Console"><span style="color: blue">try
                </span>{

                   empList = (<span style="color: blue">from </span>emps <span style="color: blue">in </span>entitiesContext.Employees
                               <span style="color: blue">select </span>emps).ToList&lt;<span style="color: #2b91af">Employees</span>&gt;();
                

                    <span style="color: #2b91af">ReportDataSource </span>rds = <span style="color: blue">new </span><span style="color: #2b91af">ReportDataSource</span>(<span style="color: #a31515">&quot;DataServiceForms_NorthwindReference_Employees&quot;</span>, empList);
                    <span style="color: blue">this</span>.reportViewer1.LocalReport.DataSources.Clear();
                    <span style="color: blue">this</span>.reportViewer1.LocalReport.DataSources.Add(rds);

                }

                    
                <span style="color: blue">catch </span>(<span style="color: #2b91af">Exception </span>_ex)
                {
                    <span style="color: #2b91af">MessageBox</span>.Show(_ex.Message);

                }
            }

            </font></font><font size="2"><font face="Lucida Console"><span style="color: green">//get all the employee ids and bind it 

            </span><span style="color: blue">var </span>empIDs = <span style="color: blue">from </span>emps <span style="color: blue">in </span>empList
                         <span style="color: blue">select </span>emps.EmployeeID;
            <span style="color: blue">foreach </span>(<span style="color: blue">int </span>i <span style="color: blue">in </span>empIDs)
            {
                <span style="color: blue">this</span>.comboBox1.Items.Add(i);
            }
            </font></font><font size="2"><font face="Lucida Console"><span style="color: green">//set the combo to display the first item
            </span><span style="color: blue">this</span>.comboBox1.SelectedIndex = 0;

            </font></font><font size="2"><font face="Lucida Console"><span style="color: green">//bind parameters to the report
            </span>BindParameter();
        }</font></font></pre>
<a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a>

<p><font size="2" face="Lucida Console"></font></p>

<pre class="code"><font size="2"><font face="Lucida Console"><span style="color: blue">      private void </span>BindParameter()
       {
           <span style="color: #2b91af">ReportParameter </span>param = <span style="color: blue">new </span><span style="color: #2b91af">ReportParameter</span>(<span style="color: #a31515">&quot;EmpID&quot;</span>, <span style="color: blue">this</span>.comboBox1.SelectedItem.ToString());
           <span style="color: blue">this</span>.reportViewer1.LocalReport.SetParameters(<span style="color: blue">new </span><span style="color: #2b91af">ReportParameter</span>[] { param });
           <span style="color: blue">this</span>.reportViewer1.RefreshReport();
       }
</font></font></pre>

<pre class="code"><font size="2"><font face="Lucida Console">       <span style="color: blue">private void </span>comboBox1_SelectedIndexChanged(<span style="color: blue">object </span>sender, <span style="color: #2b91af">EventArgs </span>e)
       {
           BindParameter();
       }</font></font></pre>
<a href="http://11011.net/software/vspaste"></a>

<p>The completed report looks like this </p>

<p>&#160;</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_26.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_26.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_12.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/DisplayingWCFDataServicedatainlocalrepor_A8BC/image_thumb_12.png" width="746" height="418" /></a> </p>

<p>Until next post .. </p>]]></content:encoded>
    </item>
    <item>
      <title>Referring ADO.Net Entity project in a different project</title>
      <link>https://docs.microsoft.com/archive/blogs/bindeshv/referring-ado-net-entity-project-in-a-different-project</link>
      <pubDate>Thu, 03 Sep 2009 22:53:00 GMT</pubDate>
      <dc:creator><![CDATA[Bindesh Vijayan-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bindeshv/2009/09/03/referring-ado-net-entity-project-in-a-different-project/</guid>
      <description><![CDATA[QuickPost: I just now answered a question on the forum about one of the errors that might take you a...]]></description>
      <content:encoded><![CDATA[<P><U>QuickPost:</U> <BR>I just now answered a question on the forum about one of the errors that might take you a while to figure out. Assume the following scenario, you have a Data Model Project designed as class library for EntityFramework and you have a middle layer or a UI Layer and you are referring the EF Assembly. When you try to run the project you get the&nbsp; following error </P>
<P><FONT color=#ff0000 size=2>"The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid."</FONT></P>
<P><FONT color=#ff0000 size=2><FONT color=#000000>If you go check the EntityProject you might find the connectionstring information inside the app.config. This is created automatically by the Entity Model Designer wizard. The issue is that when you refer the EntityProject inside another project the dll for the entity model is loaded in the context of the current application and hence it tries to read the connectionstring from the current app.config/web.config file.</FONT> </FONT></P>
<P>The fix is to add the connectionstring information from the EntityProject&nbsp; to your referring project’s app.config or web.config under the &lt;connectionstrings&gt; element , like this </P><PRE class=code><SPAN style="COLOR: blue">&lt;</SPAN><SPAN style="COLOR: #a31515">connectionStrings</SPAN><SPAN style="COLOR: blue">&gt;
   &lt;</SPAN><SPAN style="COLOR: #a31515">add </SPAN><SPAN style="COLOR: red">name</SPAN><SPAN style="COLOR: blue">=</SPAN>"<SPAN style="COLOR: blue">SchoolEntities</SPAN>" <SPAN style="COLOR: red">connectionString</SPAN><SPAN style="COLOR: blue">=</SPAN>"<SPAN style="COLOR: blue">metadata=res://*/SchoolModel.csdl|res://*/SchoolModel.ssdl|res://*/SchoolModel.msl;provider=System.Data.SqlClient;provider connection string=</SPAN><SPAN style="COLOR: red">&amp;quot;</SPAN><SPAN style="COLOR: blue">Data Source=.\yukon;Initial Catalog=School;Integrated Security=True;MultipleActiveResultSets=True</SPAN><SPAN style="COLOR: red">&amp;quot;</SPAN>" <SPAN style="COLOR: red">providerName</SPAN><SPAN style="COLOR: blue">=</SPAN>"<SPAN style="COLOR: blue">System.Data.EntityClient</SPAN>" <SPAN style="COLOR: blue">/&gt;
&lt;/</SPAN><SPAN style="COLOR: #a31515">connectionStrings</SPAN><SPAN style="COLOR: blue">&gt;</SPAN></PRE>
<P>Here is the forum post on this <A href="http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/d0261818-ed96-43b6-adfd-3c146d8e1a68/">http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/d0261818-ed96-43b6-adfd-3c146d8e1a68/</A></P>
<P><A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"></A>&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Using EntityBag with EntityFramework over WCF</title>
      <link>https://docs.microsoft.com/archive/blogs/bindeshv/using-entitybag-with-entityframework-over-wcf</link>
      <pubDate>Fri, 28 Aug 2009 04:07:36 GMT</pubDate>
      <dc:creator><![CDATA[Bindesh Vijayan-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bindeshv/2009/08/28/using-entitybag-with-entityframework-over-wcf/</guid>
      <description><![CDATA[I was going through the article published in MSDN by Daniel Simmons about the N-Tier Patterns...]]></description>
      <content:encoded><![CDATA[<p>I was going through the article published in MSDN by Daniel Simmons about the N-Tier Patterns <a title="http://msdn.microsoft.com/en-us/magazine/dd882522.aspx" href="http://msdn.microsoft.com/en-us/magazine/dd882522.aspx">http://msdn.microsoft.com/en-us/magazine/dd882522.aspx</a> and came across the EntityBag implementation. So I went through couple of posts by Daniel on the EntityBag stuff to acquire the working knowledge and get started with EntityBag.&nbsp; The project is hosted in <a href="http://code.msdn.microsoft.com/entitybag/">codeplex</a> </p> <p>There were a couple of issues that I faced in getting it to run especially with changes in WCF and EF 3.5 sp1. So I thought of blogging about this to help get this working without much hassles.</p> <h5>Changes Needed In EntityBag</h5> <p>The first issue that you will face while compiling EntityBag project(Perseus) is the following error </p> <p><font color="#ff0000" size="1">&nbsp; No overload for method 'GetEntityKey' takes '2' arguments&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\Users\bindeshv\Code\perseus-1.1 entitybag\Perseus\UtilityExtensionMethods.cs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></p> <p>The above error happens because ObjectContext.GetEntityKey(entitySetName, object) was a beta 3 method which was removed. Though there is an extension method inside UtilityExtensionMethod.cs&nbsp; for IRleatedEnd like this </p> <blockquote> <p><font face="Consolas"><span style="color: blue">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public static </span><span style="color: #2b91af">EntityKey </span>GetEntityKey(<span style="color: blue">this</span><span style="color: #2b91af">IRelatedEnd </span>relatedEnd)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #2b91af">Debug</span>.Assert(relatedEnd.IsEntityReference());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #2b91af">Type</span>relationshipType = relatedEnd.GetType();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #2b91af">PropertyInfo </span>pi = relationshipType.GetProperty(<span style="color: #a31515">"EntityKey"</span>);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue">return</span>(<span style="color: #2b91af">EntityKey</span>)pi.GetValue(relatedEnd, <span style="color: blue">null</span>);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</font></p></blockquote> <p>But the actual code calling this method is on ObjectContext in our CreateOriginalValuesObject method like this </p> <blockquote><pre class="code"><span style="color: #2b91af">      EntityKey </span>targetKey = context.GetEntityKey(fullEntitySetName, target);</pre></blockquote><a href="http://11011.net/software/vspaste"></a>
<p>Since the intent here was to get the entity key for the target object and then get its ObjectStateEntry and then clone the original entries in the source to target, I changed the code to like this&nbsp; </p>
<p>&nbsp;</p><pre class="code"><span style="color: green">          // EntityKey targetKey = context.GetEntityKey(target);
            </span><span style="color: #2b91af">ObjectStateEntry </span>targetStateEntry = context.ObjectStateManager.GetObjectStateEntry(target);</pre><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a>
<h5>Changes In WCF Service</h5>
<p>To test the program I created the following service contract and tried exposing it over WsHttpbinding </p><pre class="code">   [<span style="color: #2b91af">ServiceContract</span>]
   <span style="color: blue">public interface </span><span style="color: #2b91af">INorthwind
  </span>{
      [<span style="color: #2b91af">OperationContract</span>]
       <span style="color: #2b91af">EntityBag</span>&lt;NorthwindModel.<span style="color: #2b91af">Customers</span>&gt; GetCustomerByID(<span style="color: blue">string </span>customerID);

      [<span style="color: #2b91af">OperationContract</span>]
      <span style="color: blue">void </span>UpdateCustomer(<span style="color: #2b91af">EntityBag</span>&lt;NorthwindModel.<span style="color: #2b91af">Customers</span>&gt; customers);

      [<span style="color: #2b91af">OperationContract</span>] //for test<br>      <span style="color: blue">int </span>Test(<span style="color: blue">int </span>p);


  }</pre><a href="http://11011.net/software/vspaste"></a>
<p>But each time I tried getting this over to the client I will get a weird error on the client (took 2 days to figure this out) </p>
<p><font color="#ff0000" size="2" face="Consolas">An error occurred while receiving the HTTP response to http://binvij-admin2.fareast.corp.microsoft.com/NorthwindSVC/Northwind.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. </font></p>
<p><font color="#ff0000" size="2" face="Consolas">Server stack trace: </font>
<p><font color="#ff0000">&nbsp;<font size="2" face="Consolas">&nbsp; at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)</font></font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)</font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)</font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Channels.ClientReliableChannelBinder`1.RequestClientReliableChannelBinder`1.OnRequest(TRequestChannel channel, Message message, TimeSpan timeout, MaskingMode maskingMode)</font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Channels.ClientReliableChannelBinder`1.Request(Message message, TimeSpan timeout, MaskingMode maskingMode)</font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Channels.ClientReliableChannelBinder`1.Request(Message message, TimeSpan timeout)</font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.Request(Message message, TimeSpan timeout)</font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)</font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)</font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)</font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)</font>
<p><br>I implemented a WCF trace, more details here on enabling the <a href="http://msdn.microsoft.com/en-us/library/ms733025.aspx">trace</a> , and saw the following logged in <br><br>&lt;<font color="#ff0000" size="2" face="Consolas">ExceptionType&gt;System.ServiceModel.CommunicationException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;/ExceptionType&gt;</font></p>
<p><font color="#ff0000" size="2" face="Consolas">&lt;Message&gt;<strong>There was an error while trying to serialize parameter http://tempuri.org/:GetCustomerByIDResult. The InnerException message was 'Type 'NorthwindModel.Customers' with data contract name 'Customers:http://schemas.datacontract.org/2004/07/NorthwindModel' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details.&lt;/</strong>Message&gt;</font>
<p><font color="#ff0000" size="2" face="Consolas">&lt;StackTrace&gt;at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameterPart(XmlDictionaryWriter writer, PartInfo part, Object graph) at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameter(XmlDictionaryWriter writer, PartInfo part, Object graph) at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeBody(XmlDictionaryWriter writer, MessageVersion version, String action, MessageDescription messageDescription, Object returnValue, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.OperationFormatter.SerializeBodyContents(XmlDictionaryWriter writer, MessageVersion version, Object[] parameters, Object returnValue, Boolean isRequest) at </font>
<p><font color="#0000ff" size="2" face="Consolas"></font>&nbsp; <p><font color="#0000ff" size="2" face="Consolas">The DataContractSerializer did not know about my Northwind.Customers type so I had to append my ServiceContract with </font><pre class="code"> [<span style="color: #2b91af">ServiceContract</span>]
 <strong>[<span style="color: #2b91af">ServiceKnownType</span>(<span style="color: blue">typeof</span>(NorthwindModel.<span style="color: #2b91af">Customers</span>))]</strong>
 
  <span style="color: blue">public interface </span><span style="color: #2b91af">INorthwind
  </span>{
      [<span style="color: #2b91af">OperationContract</span>]
     
      <span style="color: #2b91af">EntityBag</span>&lt;NorthwindModel.<span style="color: #2b91af">Customers</span>&gt; GetCustomerByID(<span style="color: blue">string </span>customerID);
<font face="Verdana"></font></pre><pre class="code"><font face="Verdana"><strong>Note: This is missing in the client test project for EntityBag in the  demo<br></strong></font></pre><pre class="code"><font face="Verdana">After this I got an error at the client end, though I could see the WCF service sending the EntityBag&lt;Customers&gt; successfully. Here is the error<br></font><font face="Verdana"> message <br></pre></font><br>
<p><font color="#ff0000" size="2" face="Consolas">The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter </font><a href="http://tempuri.org/:GetCustomerByIDResult"><font color="#ff0000" size="2" face="Consolas">http://tempuri.org/:GetCustomerByIDResult</font></a><font color="#ff0000" size="2" face="Consolas">. The InnerException message was 'Error in line 1 position 1808. Element '</font><a href="http://schemas.microsoft.com/2003/10/Serialization/Arrays:anyType'"><font color="#ff0000" size="2" face="Consolas">http://schemas.microsoft.com/2003/10/Serialization/Arrays:anyType'</font></a><font color="#ff0000" size="2" face="Consolas"> contains data of the '</font><a href="http://schemas.datacontract.org/2004/07/NorthwindModel:Customers'"><font color="#ff0000" size="2" face="Consolas">http://schemas.datacontract.org/2004/07/NorthwindModel:Customers'</font></a><font color="#ff0000" size="2" face="Consolas"> data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to 'Customers' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.'.&nbsp; Please see InnerException for more details. </font>
<p><font color="#ff0000" size="2" face="Consolas">Server stack trace: </font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest) </font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest) </font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest) </font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeReply(Message message, Object[] parameters) </font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Dispatcher.ProxyOperationRuntime.AfterReply(ProxyRpc&amp; rpc) </font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc) </font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) </font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) </font>
<p><font color="#ff0000" size="2" face="Consolas">&nbsp;&nbsp; at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)</font>
<p><font color="#ff0000" size="2" face="Consolas"></font>&nbsp; <p><font color="#ff0000" size="2" face="Consolas"><font color="#000000" face="Verdana">We get this error due to an inappropriate setting of the buffer size for the binding in use. Check this link for more details</font><br></font><a title="http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/e0bac3a6-f758-499b-9cab-32435b9887ea" href="http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/e0bac3a6-f758-499b-9cab-32435b9887ea">http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/e0bac3a6-f758-499b-9cab-32435b9887ea</a><font color="#ff0000" size="2" face="Consolas"><br></font></p>
<p><font color="#000000" size="2">The fix is to increase the messagesize for both the client and the service in the config file</font></p><pre class="code"><span style="color: blue">         &lt;</span><span style="color: #a31515">wsHttpBinding</span><span style="color: blue">&gt;
         &lt;</span><span style="color: #a31515">binding </span><span style="color: red">name</span><span style="color: blue">=</span>"<span style="color: blue">AllowLargeMessages</span>" <span style="color: red">maxReceivedMessageSize</span><span style="color: blue">=</span>"<span style="color: blue">512000</span>" <span style="color: red">maxBufferPoolSize</span><span style="color: blue">=</span>"<span style="color: blue">512000</span>" <span style="color: blue">&gt;
           &lt;</span><span style="color: #a31515">readerQuotas </span><span style="color: red">maxArrayLength</span><span style="color: blue">=</span>"<span style="color: blue">5000000</span>" <span style="color: blue">/&gt;
         &lt;/</span><span style="color: #a31515">binding</span><span style="color: blue">&gt;
        &lt;/</span><span style="color: #a31515">wsHttpBinding</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a>&nbsp;</p>
<p>And this should help getting your EntityBag serialized and Deserialized. </p>
<p>Hope this helps !</p>]]></content:encoded>
    </item>
    <item>
      <title>TechEd@Hyderabad-Day2</title>
      <link>https://docs.microsoft.com/archive/blogs/bindeshv/techedhyderabad-day2</link>
      <pubDate>Fri, 15 May 2009 00:10:35 GMT</pubDate>
      <dc:creator><![CDATA[Bindesh Vijayan-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bindeshv/2009/05/15/techedhyderabad-day2/</guid>
      <description><![CDATA[Could not post the details yesterday coz I was tired attending many sessions. Here are the major...]]></description>
      <content:encoded><![CDATA[<p>Could not post the details yesterday coz I was tired attending many sessions. Here are the major points from the sessions I attended </p>  <h5><font color="#0000ff">SQL Server 2008 -Beyond Relational Data by Praveen Srivatsa, Asthrasoft Consulting</font></h5>  <p><strong>XML Feature     <br /></strong>We deal with most of the data that is Non Relational in nature</p>  <p>SQL Server 2008 has support for non relational data and it provides various data types </p>  <p>You can use XQuery with Xml type. This allows you to specify a schema as well so you have some control over the type being stored. In general the data can be stored in XML type and retrieved as a relational model or vice versa</p>  <p>Mapping of new date/time data types to xsd types </p>  <p><strong>CLR Feature     <br /></strong>Lots of queries around this feature from many people. And I got scared about this atleast from the Support aspect of it . Developers wanted to put many things as a CLR object. And below is my thought about this </p>  <p>Only 13 assemblies are allowed to be used called 'Blessed Assemblies'. UNSAFE load of an assembly can cause SQL Server memory corruption since it loads it inside MTL which is used for by sql server for external hosting of COM,CLR and out process providers </p>  <p><strong>Filestreams</strong>    <br />Benefits of filestream against BLOB types explained. Books OnLine(BOL) has more details on this.</p>  <p>&#160;</p>  <h5><font color="#0000ff">ADO.NET Data Services Futures by Harish Ranganathan, Developer Evangelist</font></h5>  <p>This talk was about ADO.Net Data Services offline still under development. Harish showed a smart client which can work offline. This is pretty pre-beta state. There were a lot of queries but most of them I believe would be clear if one goes through the ADO.Net synchronization services like one of the query was how does this handle a conflict of column&#160; here is the MSDN page for this <a title="http://msdn.microsoft.com/en-us/library/bb726002.aspx" href="http://msdn.microsoft.com/en-us/library/bb726002.aspx">http://msdn.microsoft.com/en-us/library/bb726002.aspx</a>&#160;</p>  <p>One of the interesting questions asked in the session was :-</p>  <p>Can we keep version based copies of the modified records ? As of now I don’t this is thought about , but you can give your feedbacks on the Microsoft Connect site .   <br />    <br /></p>  <h5><font color="#0000ff">Modern Data Access Patterns and Implementations by Don Smith, Program Manager,P&amp;P</font></h5>  <p>This talk was an architect level discussion around the new patterns that should be incorporated for data access in particular with the DDD(Domain Driven Design). There is a lot being discussed about this in the P&amp;P group and they are working on few patterns for data access, the code for which will be released once the VS 2010 beta is available. The pattern thats being explored are    <br /></p>  <ul>   <li>Unit of work</li>    <li>ActiveRecords</li>    <li>Repository pattern     <br /></li> </ul>  <p>Check the codeplex site for more details <a title="http://www.codeplex.com/dataguidance" href="http://www.codeplex.com/dataguidance">http://www.codeplex.com/dataguidance</a></p>  <p>&#160;</p>  <h5><font color="#0000ff">Building scalable applications using Velocity by Abid Khan, Program Manager, Velocity</font> </h5>  <p>Velocity is the new kid on the block was distributed caching. Many cool features in particular the load balancing. One of the internals is that this was purely build using .NET FX and leveraging the WCF as the backend for query over NamedPipes channel. Pretty much utilizes most of the concepts from clustering world and automatically detects any offline and online of hosted velocity server. Key takeaways    <br /></p>  <ul>   <li>As of now it does not invalidate the cache and refresh itself from the database. Going forward this will be thought about      <br /></li>    <li>Please use a dedicated servers for velocity rather than clubbing it with the SQL Server or Web Farm     <br /></li>    <li>Velocity can be enabled for High Availability where in it will replicate the data across different hosted servers and thus available any time      <br /></li>    <li>Can be used in any .net client </li> </ul>  <h6>Vision/Road Map</h6>  <ul>   <li>Being able to provide LINQ interfaces to query instead of the traditional get/put methods     <br /></li>    <li>Support for non .NET clients like PHP      <br /></li>    <li>Availability for HPC (High Performance Computing)</li> </ul>  <p>More details here at MSDN site <a title="http://msdn.microsoft.com/en-au/data/cc655792.aspx" href="http://msdn.microsoft.com/en-au/data/cc655792.aspx">http://msdn.microsoft.com/en-au/data/cc655792.aspx</a></p>  <p>&#160;</p>  <p>until next post :) </p>]]></content:encoded>
    </item>
    <item>
      <title>TechEd@Hyderabad-Day1</title>
      <link>https://docs.microsoft.com/archive/blogs/bindeshv/techedhyderabad-day1</link>
      <pubDate>Wed, 13 May 2009 13:08:00 GMT</pubDate>
      <dc:creator><![CDATA[Bindesh Vijayan-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bindeshv/2009/05/13/techedhyderabad-day1/</guid>
      <description><![CDATA[Today I attended TechED-09. Here are the updates from the sessions I attended and some of the...]]></description>
      <content:encoded><![CDATA[<P>Today I attended TechED-09. Here are the updates from the sessions I attended and some of the interesting things I found out </P>
<H5><STRONG><FONT color=#0080ff>ASP.NET 4.0 Features from Stephen Walther, Program Manager, ASP.NET</FONT></STRONG></H5>
<UL>
<LI>Source based development, more focus on a neater and readable code</LI>
<LI>Asp.net control’s client side ID code looked weird, so if you were using a client side script framework like JQuery it would be difficult to identify the control’s id in case a control lives inside a Master page. In ASP.Net 4.0 there is a property called <FONT face=Consolas><STRONG>{Control}.ControlID</STRONG> <FONT face=Verdana>that will allow to the users to specify a more neater feature</FONT></FONT></LI>
<LI>Auto rendering of the code with "runat=server” attribute once picked from intelli sense&nbsp; for common controls </LI>
<LI>&lt;asp:formview&gt; and &lt;asp:listview&gt; now allows you to render them in div mode apart from the traditional table mode</LI>
<LI>Viewstate can be disabled at the page level and then enabled for particular controls .&nbsp; This is different from the EnableViewState mode since ViewState is inherited to the child controls whereas the EnableViewState does not </LI>
<LI>Response.Redirect was not SEO friendly and search engine had issues with indexing them . Now asp.net 4.0 enables you to use Response.PermanentRedirect which emits a status code that is recognized by Search Engines(i believe it is status code 301 if i am remembering this correctly)</LI>
<LI>New control added in asp.net 4 –&gt;&nbsp; QueryExtender . More about this here <A title=http://blogs.microsoft.co.il/blogs/bursteg/archive/2009/04/12/asp-net-queryextender-control-and-domaindatasource.aspx href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2009/04/12/asp-net-queryextender-control-and-domaindatasource.aspx" mce_href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2009/04/12/asp-net-queryextender-control-and-domaindatasource.aspx">http://blogs.microsoft.co.il/blogs/bursteg/archive/2009/04/12/asp-net-queryextender-control-and-domaindatasource.aspx</A> <BR></LI>
<LI>Features added to ASP.Net Core are </LI>
<UL>
<LI>Cache Extensibility using Velocity</LI>
<LI>Browser capabilities extensibility</LI>
<LI>Session state compression using 2 main industry standards . One of them is GZIP</LI></UL></UL>
<P>Some of the interesting questions asked by attendees are and there answers by Stephen</P>
<UL>
<LI>Can i deploy ASP.NET application to the cloud(Microsoft Azure) ? <BR>&nbsp; You can use visual studio 2008 azure toolkit to deploy the applications to Azure <BR></LI>
<LI>When do we use Silverlight vs ASP.NET Web Forms vs ASP.NET MVC vs ASP.Net Ajax <BR>These are targeted to different needs and hence different problems. <BR></LI>
<LI>How can i combine some features from asp.net 4.0 and dynamic data . Can we club them ? <BR>Yes you can. <BR></LI>
<LI>Check ASP.Net 4.0 and VS 2010 features White paper here <A title=http://www.asp.net/learn/whitepapers/aspnet40/ href="http://www.asp.net/learn/whitepapers/aspnet40/" mce_href="http://www.asp.net/learn/whitepapers/aspnet40/">http://www.asp.net/learn/whitepapers/aspnet40/</A></LI></UL>
<H5><STRONG><FONT color=#0080ff>ASP.Net MVC from Stephen Walther</FONT></STRONG></H5>
<P><STRONG></STRONG>Well most of this talk was a walk through of a demo application and it was quite interesting. Some of the main features from MVC RTM that needs to be mentioned are </P>
<UL>
<LI>SEO based URLs <BR></LI>
<LI>PartialAjaxUpdate <BR></LI>
<LI>Velocity code templates available(this one refers to the java Velocity) <BR></LI>
<LI>Create your own code generation for View creation using T4 templates</LI></UL>
<H5><FONT color=#0080ff>LINQ Deep Drive from Sanjay Vyas</FONT></H5>
<P>This session was like starting from the beginning like how Linq works. So I am not going to spend time detailing it , there is plenty information already available on the net. I will post some interesting questions asked in the session and my answers to the same </P>
<UL>
<LI>Is the var keyword reflected at runtime ? <BR>No, the CompilerService actually converts it to a type but does not give it a name. It actually looks something like this&nbsp; if you use ILDasm</LI>
<P><FONT color=#008000 size=2 face=Consolas>class [System.Core]System.Func`2&lt;int32,<STRONG><FONT size=3>class '&lt;&gt;f__AnonymousType0`1'&lt;int32&gt;&gt;</FONT></STRONG> LinqTest.Program::'CS$&lt;&gt;9__CachedAnonymousMethodDelegate4'</FONT> </P>
<LI>Can we use Linq for existing Datasets ? <BR>Yes, but only if you compile it with .net 3.5 framework. Here is more details about this on&nbsp; MSDN <A title=http://msdn.microsoft.com/en-us/library/bb386977.aspx href="http://msdn.microsoft.com/en-us/library/bb386977.aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb386977.aspx">http://msdn.microsoft.com/en-us/library/bb386977.aspx</A>&nbsp; <BR></LI>
<LI>Whats the benefit of Property initializers , can’t i use constructors instead ? <BR>In a normal code you can but when you are writing a Linq Select statement and creating a new type the initializer becomes handy <BR></LI>
<LI>Is the return type of the following query an IList&lt;int&gt;&nbsp; <BR><BR><STRONG><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200"></SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #f0dfaf">List</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">&lt;</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #eaeaac">int</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">&gt;</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #f8ffc6">list</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">=</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #eaeaac">new</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #f0dfaf">List</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">&lt;</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #eaeaac">int</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">&gt;() {</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #8acccf">1</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">,</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #8acccf">2</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">,</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #8acccf">3</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">,</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #8acccf">4</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">,</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #8acccf">5</SPAN></STRONG><STRONG><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">}; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #eaeaac">var </SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #f8ffc6">res</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">=</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #eaeaac">from </SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #f8ffc6">o </SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #eaeaac">in </SPAN></STRONG><STRONG><SPAN style="BACKGROUND: #2e2e2e; COLOR: #f8ffc6">list&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #eaeaac">where </SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #f8ffc6">o </SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">&gt;</SPAN></STRONG><STRONG><SPAN style="BACKGROUND: #2e2e2e; COLOR: #8acccf">2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #eaeaac">select</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">(</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #eaeaac">new</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">{</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #f8ffc6">iVal </SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">=</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #f8ffc6">o</SPAN><SPAN style="BACKGROUND: #2e2e2e; COLOR: #d2d200">});&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></STRONG></LI><A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"></A></UL>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; No, instead would be a type of IEnumerable&lt;int&gt;</P>
<UL>
<LI>Is there a performance hint while using Linq <BR>Not that we know of , but in case you find one, send us a repro code with the details of the delay&nbsp;&nbsp; <BR></LI>
<LI>What is the difference between IQueryable and IEnumerable <BR>Graphically put <BR><BR><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/TechEdHyderabadDay1_13E56/image_2.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/TechEdHyderabadDay1_13E56/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/TechEdHyderabadDay1_13E56/image_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/TechEdHyderabadDay1_13E56/image_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/TechEdHyderabadDay1_13E56/image_thumb.png" width=870 height=521 mce_src="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/TechEdHyderabadDay1_13E56/image_thumb.png"></A> <BR></LI></UL>
<P>&nbsp;&nbsp;&nbsp; Simply put IQueryable allows the mechanism for expression evaluation using queries. IEnumerator allows you to enumerate the collection. IQueryable on evaluation of a query expression gives you back a Enumerator for the resultant collection </P>
<P>Until next post :) </P>]]></content:encoded>
    </item>
    <item>
      <title>Using Stored Procedures That Return Non Entity Type</title>
      <link>https://docs.microsoft.com/archive/blogs/bindeshv/using-stored-procedures-that-return-non-entity-type</link>
      <pubDate>Fri, 21 Nov 2008 08:33:31 GMT</pubDate>
      <dc:creator><![CDATA[Bindesh Vijayan-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bindeshv/2008/11/21/using-stored-procedures-that-return-non-entity-type/</guid>
      <description><![CDATA[In&nbsp; the previous post I explained how to use a Stored Procedure in Entity Framework that...]]></description>
      <content:encoded><![CDATA[<p><font size="2">In&nbsp; the previous post I explained how to use a Stored Procedure in Entity Framework that returns an Entity Type.&nbsp; However, if you try to map a stored procedure that is of a scalar type or returns an Array or List type then this won't work automatically with the current release of Entity Framework.</font></p> <p><font size="2">In order to get this working you might need to implement a partial class and then specify the method. So lets take a look at how to use a Sproc that returns a Distinct Country names from Northwind.Customers</font></p><pre class="code"><font size="2"><font face="Consolas"><span style="color: blue">CREATE PROCEDURE </span>dbo.GetCountryList
</font></font><font size="2"><font face="Consolas"><span style="color: blue">AS
    BEGIN
     SET NOCOUNT ON 
      SELECT DISTINCT </span>COUNTRY <span style="color: blue">FROM </span>CUSTOMERS <span style="color: blue">ORDER BY </span>COUNTRY </font></font><span style="color: blue"><font face="Consolas" size="2">ASC
     
  END</font> 
</span></pre>
<p>&nbsp;</p>
<p><font size="2">First we might need to add the stored procedure inside the EDMX schema as we did in the previous stored procedure demo. So in the Model browser go ahead and the stored procedure by first adding it to Store Model and the adding the Function Import. Here is a screenshot</font></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresThatReturnNonEntity_FD50/image_8.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresThatReturnNonEntity_FD50/image_8.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="294" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresThatReturnNonEntity_FD50/image_thumb_3.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresThatReturnNonEntity_FD50/image_thumb_3.png" width="408" border="0"></a> </p>
<p><font size="2"></font>&nbsp;</p>
<p><font size="2">Notice that I have the return type as Scalar.&nbsp; This will generate the following CSDL element </font></p><pre class="code"><font size="2"><font face="cons"><span style="color: blue">&lt;</span><span style="color: #a31515">FunctionImport </span><span style="color: red">Name</span><span style="color: blue">=</span>"<span style="color: blue">GetCountryList</span>" <span style="color: red">ReturnType</span><span style="color: blue">=</span>"<span style="color: blue">Collection(String)</span>" <span style="color: blue">/&gt;&lt;/</span><span style="color: #a31515">EntityContainer</span><span style="color: blue">&gt;</span></font></font></pre><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a>
<p><a href="http://11011.net/software/vspaste"></a><font size="2">The return type element specify that its a Collection of String. Lets implement the partial class and write the code for calling the stored procedure </font></p><pre class="code"><font size="2"><font face="cons"><span style="color: blue">public partial class </span><span style="color: #2b91af">NorthwindEntities </span>:<span style="color: blue">global</span>::System.Data.Objects.</font></font><font size="2"><font face="cons"><span style="color: #2b91af">ObjectContext
 </span>{
    </font></font><span style="color: gray"><font face="cons" size="2">/// &lt;summary&gt;
    /// </font></span><span style="color: green"><font face="cons" size="2">Implementation for calling a method that returns distinct country list
    </font></span><font size="2"><font face="cons"><span style="color: gray">/// &lt;/summary&gt;
    /// &lt;returns&gt;</span><span style="color: green">String collection </span></font></font><font size="2"><font face="cons"><span style="color: gray">&lt;/returns&gt;
    </span><span style="color: blue">public </span><span style="color: #2b91af">Collection</span>&lt;<span style="color: blue">string</span>&gt; GetCountryList()
    {
        <span style="color: #2b91af">Collection</span>&lt;<span style="color: blue">string</span>&gt; results = <span style="color: blue">new </span><span style="color: #2b91af">Collection</span>&lt;<span style="color: blue">string</span>&gt;();

        </font></font><font size="2"><font face="cons"><span style="color: blue">try
        </span>{
            </font></font><font size="2"><font face="cons"><span style="color: green">//get the connection object from the DataContext
            </span><span style="color: blue">using </span>(<span style="color: #2b91af">DbConnection </span>conn = <span style="color: blue">this</span>.Connection)
            {
                <span style="color: #2b91af">DbCommand </span>cmd = conn.CreateCommand();
                </font></font><font size="2"><font face="cons"><span style="color: green">//command text is of the format of 'ContainerName.Stored Proc Name' 
                </span>cmd.CommandText = <span style="color: #2b91af">String</span>.Format(<span style="color: #a31515">"{0}.{1}"</span>, <span style="color: blue">this</span>.DefaultContainerName, <span style="color: #a31515">"GetCountryList"</span>);
                cmd.CommandType = System.Data.<span style="color: #2b91af">CommandType</span>.StoredProcedure;
                <span style="color: blue">if </span>(<span style="color: blue">this</span>.Connection.State != System.Data.<span style="color: #2b91af">ConnectionState</span>.Open)
                {
                    <span style="color: blue">this</span>.Connection.Open();
                }

                <span style="color: blue">var </span>reader = cmd.ExecuteReader(<span style="color: #2b91af">CommandBehavior</span>.SequentialAccess);
                <span style="color: blue">while </span>(reader.Read())
                {
                    results.Add((<span style="color: blue">string</span>)reader[0]);
                }

                <span style="color: blue">return </span>results;
            }
        }
        <span style="color: blue">catch </span>(<span style="color: #2b91af">Exception </span>ex)
        {
            </font></font><font size="2"><font face="cons"><span style="color: green">//Todo: meaning full exception handling 
        </span>}



        <span style="color: blue">return </span>(<span style="color: #2b91af">Collection</span>&lt;<span style="color: blue">string</span>&gt;)<span style="color: blue">null</span>;
       
    }
 }</font></font></pre><a href="http://11011.net/software/vspaste"></a>
<p><font size="2">Once this is compile you will be able to call this method from the front end using intellisense as shown in the screenshot below</font></p>
<p><font size="2"><br></font><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresThatReturnNonEntity_FD50/image_2.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresThatReturnNonEntity_FD50/image_2.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 5px 0px; border-right-width: 0px" height="332" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresThatReturnNonEntity_FD50/image_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresThatReturnNonEntity_FD50/image_thumb.png" width="835" border="0"></a> </p>
<p><font size="2">Here is the code for forms binding</font></p>
<p>&nbsp;</p><pre class="code"><font size="2"><font face="cons"><span style="color: blue">private void </span>Form1_Load(<span style="color: blue">object </span>sender, <span style="color: #2b91af">EventArgs </span>e)
       {
           <span style="color: blue">using </span>(<span style="color: #2b91af">NorthwindEntities </span>entities = <span style="color: blue">new </span><span style="color: #2b91af">NorthwindEntities</span>())
           {
               <span style="color: blue">this</span>.customersBindingSource.DataSource = entities.CustByCountry(<span style="color: #a31515">"Germany"</span>);
               </font></font><font size="2"><font face="cons"><span style="color: green">//bind the combo box
               //get the list of countries
               </span><span style="color: blue">var </span>countries = entities.GetCountryList();
               </font></font><font size="2"><font face="cons"><span style="color: green">//for each country item in countries 
               </span><span style="color: blue">foreach </span>(<span style="color: blue">var </span>c <span style="color: blue">in </span>countries)
               {
                   </font></font><font size="2"><font face="cons"><span style="color: green">//add the country name
                   </span><span style="color: blue">this</span>.toolStripComboBox1.Items.Add(c);

               }

           }
       }</font></font></pre>
<p>&nbsp;</p>
<p><font size="2">And here is the output of the forms binding</font></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresThatReturnNonEntity_FD50/image_10.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresThatReturnNonEntity_FD50/image_10.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="397" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresThatReturnNonEntity_FD50/image_thumb_4.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresThatReturnNonEntity_FD50/image_thumb_4.png" width="737" border="0"></a></p>]]></content:encoded>
    </item>
    <item>
      <title>Using Stored Procedures in Entity Framework</title>
      <link>https://docs.microsoft.com/archive/blogs/bindeshv/using-stored-procedures-in-entity-framework</link>
      <pubDate>Thu, 20 Nov 2008 07:22:37 GMT</pubDate>
      <dc:creator><![CDATA[Bindesh Vijayan-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bindeshv/2008/11/20/using-stored-procedures-in-entity-framework/</guid>
      <description><![CDATA[Entity framework supports stored procedure. In this post I will explore how we can use stored...]]></description>
      <content:encoded><![CDATA[<p><font size="2">Entity framework supports stored procedure. In this post I will explore how we can use stored procedures in entity framework.</font></p> <p><font size="2">I have created a Windows based application with Northwind database model(EDMX) . And have the Customer and Orders table selected.</font></p> <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_2.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_2.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="367" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_thumb.png" width="568" border="0"></a>&nbsp;</p> <p><font size="2">In order to add a stored procedure open up the Model Browser and right click on the Model.Store in this case NorthwindModel.Store</font></p> <p>&nbsp;</p> <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_4.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_4.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="205" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_thumb_1.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_thumb_1.png" width="413" border="0"></a> </p> <p><font size="2">And choose the required stored procedure. Next right click anywhere on the Edmx designer and choose Add &gt; Function Import.</font></p> <p><font size="2"></font>&nbsp;</p> <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_6.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_6.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="347" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_thumb_2.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_thumb_2.png" width="911" border="0"></a> </p> <p><font size="2">This will bring up the wizard for adding Function. Choose the procedure you had added in the Model Store and choose the return type. In this case Customers which is of type Entity</font></p> <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_8.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_8.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="300" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_thumb_3.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_thumb_3.png" width="411" border="0"></a> </p> <p><font size="2">This step will add a function to the EntityContext class. Here is how the generated code might look like </font></p><pre class="code"><span style="color: gray">        <font face="Consolas" size="2"> /// &lt;summary&gt;
        /// </font></span><span style="color: green"><font face="Consolas" size="2">There are no comments for NorthwindModel.CustByCountry in the schema.
        </font></span><font size="2"><font face="Consolas"><span style="color: gray">/// &lt;/summary&gt;
        </span><span style="color: blue">public global</span>::System.Data.Objects.<span style="color: #2b91af">ObjectResult</span>&lt;<span style="color: #2b91af">Customers</span>&gt; CustByCountry(<span style="color: blue">string </span>country)
        {
            <span style="color: blue">global</span>::System.Data.Objects.<span style="color: #2b91af">ObjectParameter </span>countryParameter;
            <span style="color: blue">if </span>((country != <span style="color: blue">null</span>))
            {
                countryParameter = <span style="color: blue">new global</span>::System.Data.Objects.<span style="color: #2b91af">ObjectParameter</span>(<span style="color: #a31515">"Country"</span>, country);
            }
            </font></font><font size="2"><font face="Consolas"><span style="color: blue">else
            </span>{
                countryParameter = <span style="color: blue">new global</span>::System.Data.Objects.<span style="color: #2b91af">ObjectParameter</span>(<span style="color: #a31515">"Country"</span>, <span style="color: blue">typeof</span>(<span style="color: blue">string</span>));
            }
            <span style="color: blue">return base</span>.ExecuteFunction&lt;<span style="color: #2b91af">Customers</span>&gt;(<span style="color: #a31515">"CustByCountry"</span>, countryParameter);
        }</font></font></pre><a href="http://11011.net/software/vspaste"></a>
<p><font face="Consolas" size="2"></font>&nbsp;</p>
<p><font face="ve" size="2">In my forms code I use an Object Data Source and have the following code for Forms_Load</font></p><pre class="code"><font size="2"><font face="Consolas"><span style="color: blue">          using </span>(<span style="color: #2b91af">NorthwindEntities </span>entities = <span style="color: blue">new </span><span style="color: #2b91af">NorthwindEntities</span>())
            {
                <span style="color: blue">this</span>.customersBindingSource.DataSource = entities.CustByCountry(<span style="color: #a31515">"Germany"</span>);
                
            }</font></font></pre>
<p><font size="2">Here is the output</font></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_10.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_10.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="310" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_thumb_4.png" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/UsingStoredProceduresinEntityFramework_FAED/image_thumb_4.png" width="729" border="0"></a> </p>
<p><a href="http://11011.net/software/vspaste"></a></p>]]></content:encoded>
    </item>
    <item>
      <title>Getting Started With EntityClient in EntityFramework</title>
      <link>https://docs.microsoft.com/archive/blogs/bindeshv/getting-started-with-entityclient-in-entityframework</link>
      <pubDate>Mon, 10 Nov 2008 01:12:31 GMT</pubDate>
      <dc:creator><![CDATA[Bindesh Vijayan-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bindeshv/2008/11/10/getting-started-with-entityclient-in-entityframework/</guid>
      <description><![CDATA[In this post I am going to illustrate how to use EdmGen and EntityClient to program with Entity...]]></description>
      <content:encoded><![CDATA[<p><font size="2">In this post I am going to illustrate how to use EdmGen and EntityClient to program with Entity Framework.</font></p> <p><font size="2">EdmGen is utility shipped with Entity Framework for creation of the artifacts required for Entity Model Mapping viz the CSDL(Conceptual Schema Definition Language), SSDL(Storage Model) and MSL(Mapping Model). Though you can use the EDM wizard in Visual Studio 2008 sp1, but since you may find a lot of references how to use the EDM wizard on internet and really less information on usage of Edmgen, I resorted to this.</font></p> <p><font size="2">Lets see how to create the artifacts for our School Database Model. The School database can be generated from the scripts available at MSDN here. [Creating the School Sample Database <a title="http://msdn.microsoft.com/en-us/library/bb399731.aspx" href="http://msdn.microsoft.com/en-us/library/bb399731.aspx">http://msdn.microsoft.com/en-us/library/bb399731.aspx</a>]</font></p> <p><font size="2">Open up Visual Studio 2008 Command Prompt and then fire the following command </font></p> <p><font face="Consolas" size="2"><strong>c:\&gt; edmgen /connectionstring:"server=.\yukon;integrated security=true;database=school" /mode:FullGeneration /project:"EntityClientDemo"</strong></font> <p><font size="2">Here is the explanation of&nbsp; the switches used with Edmgen.exe</font> <ul> <li><font size="2"><strong>/ConnectionString</strong> : specifies the connection string used for connecting to the database</font></li> <li><font size="2">/<strong>FullGeneration</strong> : Generate ssdl, msl, csdl, and objects from the database</font></li> <li><font size="2"><strong>/Project</strong> : The base name to use for the artifact files. </font></li></ul> <p><font size="2"><em>NOTE: You need to specify either this switch or all the /OutXXXXX switches if you are using the /FullGeneration switch. To get more details on the various switches use EdmGen -help</em></font></p> <p><font size="2">Next, go ahead and create a new project in Visual Studio 2008. For this post, I created a console application. And add reference System.Data.Entity.</font> <p><font size="2">Here is the code </font> <p><font size="2"></font>&nbsp;<pre class="code"><font size="2"><font face="con"><span style="color: blue">using </span>(<span style="color: #2b91af">EntityConnection </span>conn = <span style="color: blue">new </span><span style="color: #2b91af">EntityConnection</span>())
           {
               </font></font><font size="2"><font face="con"><span style="color: blue">try 
               </span>{
                  conn.ConnectionString =<br></font></font><font size="2"><font face="con"> <span style="color: #a31515">@"Metadata=C:\Users\BindeshV\Documents\Visual Studio 2008\Projects\EntityFramework\EFClientDemo\EFClientDemo\Artifacts;" </span>+
 <span style="color: #a31515">@"Provider=System.Data.SqlClient;"</span>+
 @<span style="color: #a31515">"Provider Connection String='Server=.\yukon;Integrated Security=yes;Database=School'"</span>;
                   conn.Open();
                   <span style="color: #2b91af">EntityCommand </span>cmd = conn.CreateCommand();
                   cmd.CommandText = <span style="color: #a31515">"Select C.CourseID,C.Title from EFClientDemoContext.Course as C"</span>;
                   cmd.CommandType = <span style="color: #2b91af">CommandType</span>.Text;
                   <span style="color: #2b91af">EntityDataReader </span>reader = cmd.ExecuteReader(<span style="color: #2b91af">CommandBehavior</span>.SequentialAccess);

                   <span style="color: blue">while</span>(reader.Read())
                   {
                       <span style="color: #2b91af">Console</span>.WriteLine(<span style="color: #a31515">"Course Id={0} Course Title={1}"</span>,reader.GetInt32(0),reader.GetString(1));
                   }
              }
              <span style="color: blue">catch</span>(<span style="color: #2b91af">Exception </span>ex)
               {
                   <span style="color: #2b91af">Console</span>.WriteLine(ex.StackTrace);
               }

           }

           <span style="color: #2b91af">Console</span>.Read();</font></font></pre><a href="http://11011.net/software/vspaste"></a>
<p><font size="2">Usage of EntityClient is somewhat similar to that of the SqlClient. </font>
<p><font size="2">The ConnectionString property of the EntityConnection object has 3 keywords </font>
<ul>
<li><font size="2">Metadata - The path where are the artifacts reside. In this case the .csdl,.ssdl and msl.</font></li>
<li><font size="2">Provider - The ADO.NET provider used to connect to the Database Store</font></li>
<li><font size="2">Provider Connection String - The regular connection string </font></li></ul>
<p><font size="2">Notice that the CommandText uses the format of ContainerName.EntityName . In our case the EdmGen tool had the following information for Container Name </font></p><pre class="code"><font size="2"><font face="con"><span style="color: blue">&lt;</span><span style="color: #a31515">Schema </span><span style="color: red">Namespace</span><span style="color: blue">=</span>"<span style="color: blue">EFClientDemo</span>" <span style="color: red">Alias</span><span style="color: blue">=</span>"<span style="color: blue">Self</span>" <span style="color: red">xmlns</span><span style="color: blue">=</span>"<span style="color: blue">http://schemas.microsoft.com/ado/2006/04/edm</span>"</font></font><font size="2"><font face="con"><span style="color: blue">&gt;
 <strong> &lt;</strong></span><strong><span style="color: #a31515">EntityContainer </span><span style="color: red">Name</span><span style="color: blue">=</span>"<span style="color: blue">EFClientDemoContext</span>"<span style="color: blue">&gt;</span></strong></font></font></pre>
<p><font size="2">Here is the output of the program</font></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/GettingStartedWithEntityClientinEntityFr_A493/BlogEFClientDemoOutput.jpg" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/GettingStartedWithEntityClientinEntityFr_A493/BlogEFClientDemoOutput.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="343" alt="BlogEFClientDemoOutput" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bindeshv/WindowsLiveWriter/GettingStartedWithEntityClientinEntityFr_A493/BlogEFClientDemoOutput_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/bindeshv/WindowsLiveWriter/GettingStartedWithEntityClientinEntityFr_A493/BlogEFClientDemoOutput_thumb.jpg" width="673" border="0"></a> </p>
<p><font size="2">Thanks</font></p>]]></content:encoded>
    </item>
  </channel>
</rss>