Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET
I need to know what are the update and insert query in one single function using Data context in Linq..Please help me
Posted 1-Oct-12 19:01pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Please follow the links below,
LINQ to SQL[^]
LINQ to SQL: All common operations (Insert, Update, Delete, Get) in one base class[^][^][^]
For calling a single function, add one extra input parameter "operationMode" Add/Edit.
Checking the operationMode value, you can use the appropriate calling for insert and update.
This will give you fair idea to start on your own.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 8,478
1 OriginalGriff 6,516
2 Peter Leow 3,567
3 Zoltán Zörgő 3,386
4 Richard MacCutchan 2,397

Advertise | Privacy | Mobile
Web01 | 2.8.150123.1 | Last Updated 2 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100