| By Scott Guthrie | Article Rating: |
|
| October 10, 2007 04:45 PM EDT | Reads: |
12,626 |
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,626
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.
- The Top 150 Players in Cloud Computing
- Commercial vs Federal Cloud Computing
- Why IBM’s Server Chief Got Busted
- Industry Experts Discuss the State of Cloud Computing
- Cloud Expo New York Call for Papers Now Open
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- US Federal Government is Major Cloud Computing Innovator
- Google Wave
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Adaptivity & Cloud Computing: Exclusive Q&A with CEO Tony Bishop
- 4th International Cloud Expo: Photo Album
- The Top 150 Players in Cloud Computing
- SYS-CON.TV: Cloud Computing Expo Power Panel
- Commercial vs Federal Cloud Computing
- Why IBM’s Server Chief Got Busted
- 1st Annual GovIT Expo: Letter from the Technical Chair
- Industry Experts Discuss the State of Cloud Computing
- Deputy CIO of the CIA to Keynote 1st Annual GovIT Expo
- SOA World Power Panel on SYS-CON.TV
- CIA was Headed to an Enterprise Cloud All Along: Jill Tummler Singer
- Cloud Expo New York Call for Papers Now Open
- 1st Annual Government IT Conference & Expo: Themes & Topics
- Stock in Focus: Dragon Capital
- The i-Technology Right Stuff
- Who Are The All-Time Heroes of i-Technology?
- Get the Message
- Where Are RIA Technologies Headed in 2008?
- i-Technology Viewpoint: Is Web 2.0 the Global SOA?
- i-Technology Viewpoint: Thinking Outside the VC Box
- ESB Myth Busters: 10 Enterprise Service Bus Myths Debunked
- i-Technology Viewpoint: When to Leave Your First IT Job
- SOA Web Services Edge Conference Coverage on SYS-CON.TV
- Five Reasons Why Web 2.0 Matters
- SYS-CON.TV's "SOA Web Services" and "Enterprise Open Source" Programs To Air in December
- SOA World Conference & Expo SYS-CON.TV Power Panel Live From Times Square









Cloud computing is a game changer. The cloud ...




















