<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Guy Burstein : LINQ to SQL</title><link>http://blogs.msdn.com/bursteg/archive/tags/LINQ+to+SQL/default.aspx</link><description>Tags: LINQ to SQL</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Create a Strongly Typed CRUD UI With ASP.Net MVC RC</title><link>http://blogs.msdn.com/bursteg/archive/2009/02/03/create-a-strongly-typed-crud-ui-with-asp-net-mvc-rc.aspx</link><pubDate>Tue, 03 Feb 2009 10:16:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9392813</guid><dc:creator>Guy Burstein</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/bursteg/comments/9392813.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bursteg/commentrss.aspx?PostID=9392813</wfw:commentRss><wfw:comment>http://blogs.msdn.com/bursteg/rsscomments.aspx?PostID=9392813</wfw:comment><description>&lt;h1&gt;Create a Strongly Typed CRUD UI With ASP.Net MVC RC&lt;/h1&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 0px 25px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" align="right" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/ASP.Net_ab39fab9-93f6-405f-a6d6-060579364402.jpg" width="320" height="61" /&gt;In this post I will show the tooling enhancements in ASP.Net MVC that lets you build &lt;strong&gt;CRUD&lt;/strong&gt; (&lt;strong&gt;List, Details, Create and Edit&lt;/strong&gt;) actions very fast. With a little amount of code we can create a good starting point for building a data entry application using &lt;strong&gt;ASP.Net MVC&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;1. Prepare the database. In this sample I am using the &lt;a href="http://blogs.microsoft.co.il/files/folders/220879/download.aspx"&gt;Leasing&lt;/a&gt; database, that contains 3 tables. Download the schema and create the database.&lt;/p&gt;  &lt;p&gt;2. Create a new &lt;strong&gt;ASP.Net MVC Application&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;3. Create the &lt;strong&gt;Model&lt;/strong&gt;. In this samples I am using LINQ to SQL, but you can choose any other business object representation. Add a new LINQ to SQL Data Model to the &lt;strong&gt;Model&lt;/strong&gt; folder in the MVC application project, and drag the relevant tables from the &lt;strong&gt;Server Explorer&lt;/strong&gt; into the ORM Designer. This creates classes that represent the tables and relationships in the database.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_ca2c14c5-3c1e-47bc-9ff2-df9f706a28ae.png" width="480" height="156" /&gt; &lt;/p&gt;  &lt;p&gt;4. Create a new controller. Right click the &lt;strong&gt;Controllers&lt;/strong&gt; folder in the MVC application, choose &lt;strong&gt;Add&lt;/strong&gt; and select the &lt;strong&gt;Controller&lt;/strong&gt; item.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_8e1eb54b-0808-48ad-b746-b6bb4bd8c41d.png" width="480" height="264" /&gt; &lt;/p&gt;  &lt;p&gt;Provide a name for the controller, check the “&lt;strong&gt;Add action methods for Create, Update and Details scenarios&lt;/strong&gt;”, and click &lt;strong&gt;Add&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_3e7a6fe5-693a-4e10-b05d-e9b79eb7e2cc.png" width="320" height="137" /&gt; &lt;/p&gt;  &lt;p&gt;This creates a new controller, and creates the methods for the above actions. We will explore those actions as we move on.&lt;/p&gt;  &lt;p&gt;5. Add a link to the Vehicles module. Open the master page (&lt;strong&gt;Site.Master&lt;/strong&gt; under the &lt;strong&gt;Views\Shared&lt;/strong&gt; folder), and locate the links for &lt;strong&gt;Home&lt;/strong&gt; and &lt;strong&gt;About&lt;/strong&gt;.&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;   &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;li&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;%&lt;span style="color: blue"&gt;= &lt;/span&gt;&lt;span style="color: red"&gt;Html.ActionLink&lt;/span&gt;(&amp;quot;&lt;span style="color: blue"&gt;Home&lt;/span&gt;&amp;quot;,&lt;span style="color: blue"&gt; &lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Index&lt;/span&gt;&amp;quot;,&lt;span style="color: blue"&gt; &lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Home&lt;/span&gt;&amp;quot;)%&lt;span style="color: blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;li&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;li&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;%&lt;span style="color: blue"&gt;= &lt;/span&gt;&lt;span style="color: red"&gt;Html.ActionLink&lt;/span&gt;(&amp;quot;&lt;span style="color: blue"&gt;About&lt;/span&gt;&amp;quot;,&lt;span style="color: blue"&gt; &lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;About&lt;/span&gt;&amp;quot;,&lt;span style="color: blue"&gt; &lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Home&lt;/span&gt;&amp;quot;)%&lt;span style="color: blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;li&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Add a third link to the Vehicles module:&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;li&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;%&lt;span style="color: blue"&gt;= &lt;/span&gt;&lt;span style="color: red"&gt;Html.ActionLink&lt;/span&gt;(&amp;quot;&lt;span style="color: blue"&gt;Vehicles&lt;/span&gt;&amp;quot;,&lt;span style="color: blue"&gt; &lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Index&lt;/span&gt;&amp;quot;,&lt;span style="color: blue"&gt; &lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Vehicles&lt;/span&gt;&amp;quot;)%&lt;span style="color: blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;li&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now, If you run the application, you should see a link on the upper menu.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_37cf5289-af5e-471b-8ead-7947a73f15ce.png" width="480" height="360" /&gt; &lt;/p&gt;

&lt;h3&gt;Implement the List Action: Display a list of Model Items (Vehicles)&lt;/h3&gt;

&lt;p&gt;1. Create a member of type &lt;strong&gt;VehiclesDataContext&lt;/strong&gt; in the controller. We will use this context to access the database.&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;VehiclesController&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;Controller&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: #2b91af"&gt;VehiclesDataContext&lt;/span&gt; db = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;VehiclesDataContext&lt;/span&gt;();&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: green"&gt;//&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: green"&gt;// GET: /Vehicles/&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; ...&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2. In the &lt;strong&gt;Index&lt;/strong&gt; method, query the database for the list of vehicles using a LINQ query. Then, return a view with the results.&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// GET: /Vehicles/&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Index()&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; query = &lt;span style="color: blue"&gt;from&lt;/span&gt; v &lt;span style="color: blue"&gt;in&lt;/span&gt; db.Vehicles&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;select&lt;/span&gt; v;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; View(query);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3. Create a corresponding View. Right click the code editor somewhere inside this method and choose the &lt;strong&gt;Add View&lt;/strong&gt; context item.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_a18a763c-6b93-45ad-a169-d8bb726072fe.png" width="358" height="127" /&gt; &lt;/p&gt;

&lt;p&gt;This will open the &lt;strong&gt;Add View&lt;/strong&gt; dialog that lets you choose the view properties before it is generated. In this dialog, check “&lt;strong&gt;Create strongly-typed view&lt;/strong&gt;” and select the &lt;strong&gt;Vehicle&lt;/strong&gt; class from the List. Then, in the &lt;strong&gt;View content&lt;/strong&gt; field, select &lt;strong&gt;List&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_6ae34d9f-db26-49ca-ba22-101c2f47dd1f.png" width="309" height="320" /&gt; &lt;/p&gt;

&lt;p&gt;After you click &lt;strong&gt;Add&lt;/strong&gt;, Visual Studio will generate a view that displays a table with the vehicles details.&lt;/p&gt;

&lt;p&gt;If you now run the project, and click the Vehicles link in the top menu, you should get a list of vehicles like this one:&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_831186c3-1520-49f6-8df9-864dee5474d4.png" width="480" height="320" /&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;h3&gt;Implement the Details Action: Display the details of a Model Item (Vehicle)&lt;/h3&gt;

&lt;p&gt;1. In the controller’s &lt;strong&gt;Details&lt;/strong&gt; method, use the id parameter to query the database for the specific vehicle. Then, return a view with the result.&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// GET: /Vehicles/Details/5&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Details(&lt;span style="color: blue"&gt;int&lt;/span&gt; id)&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: #2b91af"&gt;Vehicle&lt;/span&gt; v = db.Vehicles.Single(vh =&amp;gt; vh.VehicleID == id);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; View(v);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2. Create a corresponding View. Right click the code editor, and select the &lt;strong&gt;Add View&lt;/strong&gt; option. In the dialog, make sure that it is strongly-typed and the View content is &lt;strong&gt;Details&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;3. Link from the list view to the details view. Each row in the list view had a &lt;strong&gt;Details&lt;/strong&gt; link. To pass the id of the vehicle to the details action, open the Index view (Views\Vehicles\Index.aspx) and locate the &lt;strong&gt;Details&lt;/strong&gt; and &lt;strong&gt;Edit&lt;/strong&gt; links:&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt; Html.ActionLink(&amp;quot;Edit&amp;quot;, &amp;quot;Edit&amp;quot;, new { /* id=item.PrimaryKey */ }) &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt; |&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt; Html.ActionLink(&amp;quot;Details&amp;quot;, &amp;quot;Details&amp;quot;, new { /* id=item.PrimaryKey */ })&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Remove the comment from the third parameter of the ActionLink, and pass the vehicle ID:&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt; Html.ActionLink(&amp;quot;Edit&amp;quot;, &amp;quot;Edit&amp;quot;, new {&amp;#160; id = item.VehicleID&amp;#160; }) &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt; |&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt; Html.ActionLink(&amp;quot;Details&amp;quot;, &amp;quot;Details&amp;quot;, new { id = item.VehicleID })&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4. Run the application, and click the &lt;strong&gt;Vehicles&lt;/strong&gt; link to display a list of vehicles. Then click on the &lt;strong&gt;Details&lt;/strong&gt; link of the first vehicle to display its details.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_04c2a473-3693-4b46-b911-a1a4132c045c.png" width="480" height="376" /&gt; &lt;/p&gt;

&lt;h3&gt;Implement the Edit Action: Edit the details of a Model Item (Vehicle)&lt;/h3&gt;

&lt;p&gt;1. Notice that the controller has 2 overloads of the &lt;strong&gt;Edit&lt;/strong&gt; action:&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// GET: /Vehicles/Edit/5&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Edit(&lt;span style="color: blue"&gt;int&lt;/span&gt; id)&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;br /&gt;  ...&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// POST: /Vehicles/Edit/5&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;[&lt;span style="color: #2b91af"&gt;AcceptVerbs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;HttpVerbs&lt;/span&gt;.Post)]&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Edit(&lt;span style="color: blue"&gt;int&lt;/span&gt; id, &lt;span style="color: #2b91af"&gt;FormCollection&lt;/span&gt; collection)&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; ...&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The first one is for getting the vehicle details in order to display then in the View. When the user clicks the submit button, a POST message will call the second overload with the form data.&lt;/p&gt;

&lt;p&gt;2. Get the details of the vehicle to display in the view. This implementation is identical to the Display action implementation.&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// GET: /Vehicles/Edit/5&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Edit(&lt;span style="color: blue"&gt;int&lt;/span&gt; id)&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: #2b91af"&gt;Vehicle&lt;/span&gt; v = db.Vehicles.Single(vh =&amp;gt; vh.VehicleID == id);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; View(v);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3. Create a corresponding view, and make sure to select &lt;strong&gt;Edit&lt;/strong&gt; as the View content.&lt;/p&gt;

&lt;p&gt;4. Implement the Save action. In the second overload of the Edit method, get the data out of the &lt;strong&gt;FormCollection&lt;/strong&gt; instance, and apply it the the vehicle. Then save the changes to the DB, and display the list.&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// POST: /Vehicles/Edit/5&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;[&lt;span style="color: #2b91af"&gt;AcceptVerbs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;HttpVerbs&lt;/span&gt;.Post)]&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Edit(&lt;span style="color: blue"&gt;int&lt;/span&gt; id, &lt;span style="color: #2b91af"&gt;FormCollection&lt;/span&gt; collection)&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: #2b91af"&gt;Vehicle&lt;/span&gt; v = db.Vehicles.Single(vh =&amp;gt; vh.VehicleID == id);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; v.Cargo = &lt;span style="color: blue"&gt;int&lt;/span&gt;.Parse(collection[&lt;span style="color: #a31515"&gt;&amp;quot;Cargo&amp;quot;&lt;/span&gt;]);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; v.Category = &lt;span style="color: blue"&gt;int&lt;/span&gt;.Parse(collection[&lt;span style="color: #a31515"&gt;&amp;quot;Category&amp;quot;&lt;/span&gt;]);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; v.MaxSpeed = &lt;span style="color: blue"&gt;int&lt;/span&gt;.Parse(collection[&lt;span style="color: #a31515"&gt;&amp;quot;MaxSpeed&amp;quot;&lt;/span&gt;]);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; ...&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; db.SubmitChanges();&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; RedirectToAction(&lt;span style="color: #a31515"&gt;&amp;quot;Index&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;5. Enable the &lt;strong&gt;Edit&lt;/strong&gt; link in the &lt;strong&gt;Details&lt;/strong&gt; View. Open the Details View (&lt;strong&gt;Views\Vehicles\Details.aspx&lt;/strong&gt;) and locate the Edit link at the bottom. Then, remove the comment from the third parameter of the ActionLink, and pass the vehicle ID:&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;Html.ActionLink(&amp;quot;Edit&amp;quot;, &amp;quot;Edit&amp;quot;, new { id = Model.VehicleID }) &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;5. Run the application, and click the &lt;strong&gt;Vehicles&lt;/strong&gt; link to display a list of vehicles. Then, click on the &lt;strong&gt;Edit&lt;/strong&gt; link of the first vehicle to display its details for editing:&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_d259e135-834a-4230-b2a6-7da560a84120.png" width="480" height="460" /&gt; &lt;/p&gt;

&lt;p&gt;Change the values of the vehicle and click &lt;strong&gt;Save&lt;/strong&gt;. The updated values will be displayed in the list of vehicles.&lt;/p&gt;

&lt;h3&gt;Implement the Create Action: Create a new Model Item (Vehicle)&lt;/h3&gt;

&lt;p&gt;1. Notice that the Create method has 2 overloads as well. Again, one is to do any work before the Create View is shown and the other is to respond to the POST message and insert the data to the database.&lt;/p&gt;

&lt;p&gt;2. Create the Create View using the &lt;strong&gt;Add View&lt;/strong&gt; context item in the code editor. Make sure to select &lt;strong&gt;Create&lt;/strong&gt; in the &lt;strong&gt;View content&lt;/strong&gt;. In this sample you don’t have to change the logic in the Create method, since no data is necessary for creating a new vehicle.&lt;/p&gt;

&lt;p&gt;3. Implement the second overload of the &lt;strong&gt;Create&lt;/strong&gt; method. Extract the data from the &lt;strong&gt;FormCollection&lt;/strong&gt; instance, and build a new instance of &lt;strong&gt;Vehicle&lt;/strong&gt;. Then, add it to the database, and return to the list.&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// GET: /Vehicles/Create&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Create()&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; View();&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// POST: /Vehicles/Create&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;[&lt;span style="color: #2b91af"&gt;AcceptVerbs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;HttpVerbs&lt;/span&gt;.Post)]&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Create(&lt;span style="color: #2b91af"&gt;FormCollection&lt;/span&gt; collection)&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: #2b91af"&gt;Vehicle&lt;/span&gt; v = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Vehicle&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; {&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; MaxSpeed = &lt;span style="color: blue"&gt;int&lt;/span&gt;.Parse(collection[&lt;span style="color: #a31515"&gt;&amp;quot;MaxSpeed&amp;quot;&lt;/span&gt;]),&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; Model = collection[&lt;span style="color: #a31515"&gt;&amp;quot;Model&amp;quot;&lt;/span&gt;],&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;    ...&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; };&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; db.Vehicles.InsertOnSubmit(v);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; db.SubmitChanges();&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; RedirectToAction(&lt;span style="color: #a31515"&gt;&amp;quot;Index&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4. Run the application, and click the &lt;strong&gt;Vehicles&lt;/strong&gt; link to display a list of vehicles. Then, scroll to the buttom of the page and click on the &lt;strong&gt;Create New&lt;/strong&gt; link. This will show a new form that collects the details of a vehicle.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_a7c8841f-86bf-4a4d-987a-fa55c72e42a2.png" width="480" height="426" /&gt; &lt;/p&gt;

&lt;p&gt;Once you filled the data, click &lt;strong&gt;Create&lt;/strong&gt;, and the new vehicle will be displayed in the list.&lt;/p&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;The tooling enhancements in &lt;strong&gt;ASP.Net MVC RC&lt;/strong&gt; makes creating &lt;strong&gt;CRUD&lt;/strong&gt; (&lt;strong&gt;List, Details, Create and Edit&lt;/strong&gt;) actions very fast. With a little amount of code we have created a good starting point for building a data entry application using &lt;strong&gt;ASP.Net MVC&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9392813" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bursteg/archive/tags/LINQ+to+SQL/default.aspx">LINQ to SQL</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/ASP.Net+MVC/default.aspx">ASP.Net MVC</category></item><item><title>LINQ to SQL Support for SQL Server 2008</title><link>http://blogs.msdn.com/bursteg/archive/2008/05/13/linq-to-sql-support-for-sql-server-2008.aspx</link><pubDate>Tue, 13 May 2008 11:17:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8499453</guid><dc:creator>Guy Burstein</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/bursteg/comments/8499453.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bursteg/commentrss.aspx?PostID=8499453</wfw:commentRss><wfw:comment>http://blogs.msdn.com/bursteg/rsscomments.aspx?PostID=8499453</wfw:comment><description>&lt;h1&gt;LINQ to SQL Support for SQL Server 2008&lt;/h1&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/LINQtoSQLSupportforSQLServer2008_9ED7/logo2_VS_2_2.gif"&gt;&lt;img style="margin: 0px" height="70" alt="LINQ to SQL Support for SQL Server 2008" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/LINQtoSQLSupportforSQLServer2008_9ED7/logo2_VS_2_thumb.gif" width="190" align="right" border="0"&gt;&lt;/a&gt; With the release of &lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/tags/VS2008+SP1/default.aspx"&gt;Visual Studio 2008 and .Net Framework 3.5 SP1&lt;/a&gt;, &lt;strong&gt;LINQ to SQL&lt;/strong&gt; now supports some of the new features in &lt;strong&gt;SQL Server 2008&lt;/strong&gt;.&lt;/p&gt; &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/linq-to-sql-sql-server-2008-date-time-types.aspx"&gt;LINQ to SQL with SQL Server 2008 Date Time Types&lt;/a&gt; &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/linq-to-sql-filestream.aspx"&gt;LINQ to SQL and FILESTREAM&lt;/a&gt;&lt;/li&gt; &lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8499453" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bursteg/archive/tags/ADO.Net/default.aspx">ADO.Net</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/.Net+Framework+3.5/default.aspx">.Net Framework 3.5</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/LINQ+to+SQL/default.aspx">LINQ to SQL</category></item><item><title>Visual Studio 2008 and .Net Framework 3.5 SP1 Beta - A Guided Tour</title><link>http://blogs.msdn.com/bursteg/archive/2008/05/12/visual-studio-2008-and-net-framework-3-5-sp1-beta-a-guided-tour.aspx</link><pubDate>Mon, 12 May 2008 20:09:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8495378</guid><dc:creator>Guy Burstein</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/bursteg/comments/8495378.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bursteg/commentrss.aspx?PostID=8495378</wfw:commentRss><wfw:comment>http://blogs.msdn.com/bursteg/rsscomments.aspx?PostID=8495378</wfw:comment><description>&lt;h1&gt;Visual Studio 2008 and .Net Framework 3.5 SP1 Beta - A Guided Tour&lt;/h1&gt; &lt;p&gt;&lt;img style="margin: 0px" height="70" alt="Visual Studio 2008 .Net Framework 3.5 SP1  Beta" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/VisualStudio2008SP1Beta1AGuidedTour_13B66/logo2_VS_2_70b4e669-6d10-4d59-970f-003acceb3a97.gif" width="190" align="right" border="0" mce_src="http://blogs.microsoft.co.il/blogs/bursteg/WindowsLiveWriter/VisualStudio2008SP1Beta1AGuidedTour_13B66/logo2_VS_2_70b4e669-6d10-4d59-970f-003acceb3a97.gif"&gt;Over the last month I've been working with an internal build of the &lt;strong&gt;Visual Studio 2008 and .Net Framework 3.5 SP1&lt;/strong&gt; &lt;strong&gt;Beta&lt;/strong&gt; in order to explore the new features in it. This post lists all the posts I've written exploring the service pack.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Overview of the Service Pack 1&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/download-and-install-visual-studio-2008-and-net-framework-3-5-sp1-beta-kb945140.aspx"&gt;Download and Install Visual Studio 2008 and .Net Framework 3.5 SP1 Beta&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/new-assemblies-net-framework-3-5-sp1.aspx" mce_href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/new-assemblies-net-framework-3-5-sp1.aspx"&gt;New Assemblies in Visual Studio 2008 and .Net Framework 3.5 SP1&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;ADO.Net Entity Framework&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/EntityDataSource-Entity-Data-Source.aspx" mce_href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/EntityDataSource-Entity-Data-Source.aspx"&gt;EntityDataSource - Overview&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/entitydatasource-entity-data-source-where-clause.aspx" mce_href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/entitydatasource-entity-data-source-where-clause.aspx"&gt;EntityDataSource - Where Clause&lt;/a&gt;  &lt;li&gt;&lt;a href="http://channel9.msdn.com/ShowPost.aspx?PostID=403764"&gt;An Overview Screencast about EntityDataSource&lt;/a&gt;&amp;nbsp; &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;ADO.Net Data Services&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/visual-studio-2008-sp1-ado-net-data-service-walkthrough.aspx" mce_href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/visual-studio-2008-sp1-ado-net-data-service-walkthrough.aspx"&gt;A Simple ADO.Net Data Service Walkthrough&lt;/a&gt; (updated for SP1)  &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/visual-studio-2008-sp1-querying-ado-net-data-service-net-client.aspx" mce_href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/visual-studio-2008-sp1-querying-ado-net-data-service-net-client.aspx"&gt;Querying an ADO.Net Data Service via .Net Client&lt;/a&gt; (updated for SP1) &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;ADO.Net Sync Services&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/sync-services-for-ado-net-with-sql-server-2008-change-tracking.aspx" mce_href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/sync-services-for-ado-net-with-sql-server-2008-change-tracking.aspx"&gt;Sync Services for ADO.Net now use SQL Server 2008 Change Tracking&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;SQL Server 2008 and Data Access Technologies&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/sqlfilestream-managed-api-for-sql-server-2008-filestream.aspx" mce_href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/sqlfilestream-managed-api-for-sql-server-2008-filestream.aspx"&gt;&lt;strong&gt;&lt;img style="margin: 0px" height="36" alt="Visual Studio 2008 and .Net Framework 3.5 SP1 Beta" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/VisualStudio2008SP1Beta1AGuidedTour_13B66/SQL%20Server%202008_90ba9c9c-3c31-4d79-83c2-03689f747e35.gif" width="190" align="right" border="0" mce_src="http://blogs.microsoft.co.il/blogs/bursteg/WindowsLiveWriter/VisualStudio2008SP1Beta1AGuidedTour_13B66/SQL%20Server%202008_90ba9c9c-3c31-4d79-83c2-03689f747e35.gif"&gt;&lt;/strong&gt;SqlFileStream - Managed API for SQL Server 2008 FILESTREAM&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/linq-to-sql-sql-server-2008-date-time-types.aspx" mce_href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/linq-to-sql-sql-server-2008-date-time-types.aspx"&gt;LINQ to SQL with SQL Server 2008 Date Time Types&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/linq-to-sql-filestream.aspx" mce_href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/linq-to-sql-filestream.aspx"&gt;LINQ to SQL and FILESTREAM&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/ado-net-entity-framework-support-filestream.aspx" mce_href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/ado-net-entity-framework-support-filestream.aspx"&gt;ADO.Net Entity Framework support for FILESTREAM&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8495378" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bursteg/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/.Net+Framework+3.5/default.aspx">.Net Framework 3.5</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/ADO.Net+Entity+Framework/default.aspx">ADO.Net Entity Framework</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/ADO.Net+Data+Services/default.aspx">ADO.Net Data Services</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/ADO.Net+Sync+Services/default.aspx">ADO.Net Sync Services</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/LINQ+to+SQL/default.aspx">LINQ to SQL</category></item></channel></rss>