Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

Bulk UPDATE in LINQ for SQL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shimon Sim - 14 Mar 2008 03:08 GMT
Is it possible to create following query in LINQ for SQL

UPDATE Employee SET  Salary= Salary * 1.5 WHERE Employee.Job='Developer'
(Don't you like this query :-)?)
Thanks,
Shimon.
Cowboy (Gregory A. Beamer) - 14 Mar 2008 04:51 GMT
LINQ is not SQL. It is designed to query, not perform bulk CRUD. You can set
up LINQ to set up the objects and then set all to the value and update, but
this is a job I think would be better performed on the datbase personally.

Signature

Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

*************************************************

| Think outside the box!

*************************************************
> Is it possible to create following query in LINQ for SQL
>
> UPDATE Employee SET  Salary= Salary * 1.5 WHERE Employee.Job='Developer'
> (Don't you like this query :-)?)
> Thanks,
> Shimon.
Andy - 14 Mar 2008 14:17 GMT
On Mar 13, 11:51 pm, "Cowboy \(Gregory A. Beamer\)"
<NoSpamMgbwo...@comcast.netNoSpamM> wrote:
> LINQ is not SQL. It is designed to query, not perform bulk CRUD. You can set
> up LINQ to set up the objects and then set all to the value and update, but
[quoted text clipped - 15 lines]
> > Thanks,
> > Shimon.

Well, that's true, but you can execute the OPs sql using the
DataContext.ExecuteCommand or DataContext.ExecuteQuery methods.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.