| By Scott Guthrie | Article Rating: |
|
| October 10, 2007 04:45 PM EDT | Reads: |
12,576 |
4) DELETE PRODUCTS FROM THE DATABASE
The code below demonstrates how to delete all Toy products from the database:
5) CALL A STORED PROCEDURE
The code
below demonstrates how to retrieve Product entities not using LINQ
query syntax, but rather by calling the "GetProductsByCategory" stored
procedure we added to our data model. Note that once I retrieve the
Product results, I can update or delete them and then call
db.SubmitChanges() to persist the modifications back to the database.
VB:
6) Retrieve Products with Server-side Paging
The
code below demonstrates how to implement efficient server-side database
paging as part of a LINQ query. By using the Skip() and Take()
operators below, we'll only return 10 rows from the database - starting
with row 200.
Summary
LINQ-to-SQL provides a nice clean way to model the data layer of your
application. Once you've defined your data model you can easily and
efficiently perform queries, inserts, updates, and deletes against it.
Hopefully the introduction and code samples above have helped whet your
appetite to learn more. I'll be continuing this series of exploring
LINQ-to-SQL in more detail.
To read more on LINQ-to-SQL, visit Scott Guthrie's blog at http://weblogs.asp.net/scottgu.
Published October 10, 2007 Reads 12,576
Copyright © 2007 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Scott Guthrie
Scott Guthrie, who will be keynoting October 20, 2008, was a founding member of the .NET Framework team and today runs the development teams that deliver the CLR, ASP.NET, Silverlight, WPF, IIS7, and the Visual Studio tools for web, WPF and Silverlight development. Previously the General Manager of Microsoft's Developer Division, he was promoted to Corporate Vice President in February '08.
- Kindle 2 vs Nook
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Moving Your RIA Apps into the Cloud: Seven Challenges
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Windows 7 – Microsoft’s First Step to the Cloud
- Ulitzer Provides a Powerful Social Journalism Platform
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Open Source Mobile Cloud Sync and Push Email
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- US Post Office Hops a Ride on NetSuite’s Cloud
- Moving Your RIA Apps into the Cloud: Seven Challenges
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Building a Drag-and-Drop Shopping Cart with AJAX
- What Is AJAX?
- Google Maps! AJAX-Style Web Development Using ASP.NET
- Flashback to January 2006: Exclusive SYS-CON.TV Interviews on "OpenAjax Alliance" Announcement
- AJAXWorld Conference & Expo to Take Place October 2-4, 2006, at the Santa Clara Convention Center, California
- AJAX Sponsor Webcasts Are Now Available at AJAXWorld Website
- How and Why AJAX, Not Java, Became the Favored Technology for Rich Internet Applications
- "Real-World AJAX" One-Day Seminar Arrives in Silicon Valley
- AJAXWorld University Announces AJAX Developer Bootcamp
- AJAX Support In JadeLiquid WebRenderer v3.1
- Where Are RIA Technologies Headed in 2008?
- Struts Validations Framework Using AJAX





































