Click here to Skip to main content
14,330,375 members
   

C#

 
AnswerRe: non intersecting circles Pin
Gerry Schmitz10-Apr-19 6:46
mveGerry Schmitz10-Apr-19 6:46 
AnswerRe: non intersecting circles Pin
Luc Pattyn10-Apr-19 9:58
professionalLuc Pattyn10-Apr-19 9:58 
Questioncan't catch task exception with C# Pin
Member 142229339-Apr-19 16:08
memberMember 142229339-Apr-19 16:08 
AnswerRe: can't catch task exception with C# Pin
Member 142229339-Apr-19 18:07
memberMember 142229339-Apr-19 18:07 
AnswerRe: can't catch task exception with C# Pin
OriginalGriff9-Apr-19 20:05
protectorOriginalGriff9-Apr-19 20:05 
AnswerRe: can't catch task exception with C# Pin
Nathan Minier10-Apr-19 2:13
professionalNathan Minier10-Apr-19 2:13 
AnswerRe: can't catch task exception with C# Pin
Richard Deeming15-Apr-19 8:11
mveRichard Deeming15-Apr-19 8:11 
QuestionCompare Two Complex List of data Pin
V Krishna9-Apr-19 16:07
memberV Krishna9-Apr-19 16:07 
When I am Trying to save current list of data into database, I need to get already existing data from database, and need to compare with current list of data.

I have two lists one is PreviousList(existing data from DB) and other is CurrentList(Modified data)


    public class SoftClose
    {
        public int ID = -1;
        public int AID = -1;
        public int WFID = -1;
        public string PREFIX;
        public DateTime SCDATE;
        public string STATUS;
    }


PreviousList
------------
ID		Status		AID		WFID 	PREFIX		SCDATE
1		NO_CHANGE	19		388		D1			01/28/2019
2		NO_CHANGE	20		388		D2			02/25/2019
3		NO_CHANGE	21		388		D3			03/30/2019

CurrentList
-----------
ID		Status		AID		WFID 	PREFIX		SCDATE
1		NO_CHANGE	19		388		D2			01/28/2019
2		NO_CHANGE	20		388		D2			02/25/2019
3		NO_CHANGE	21		388		D3			03/30/2019
4		NO_CHANGE	22		388		D4			04/09/2019


In CurrentList I modified Prefix to D2 where ID=1 and added new row(Id=4)...

My req is

When I am trying to save CurrentList to Db,

If there is any new Prefix in CurrentList that is not there in PreviousList I need to insert that new row and need to change Status to ADD for that row.

I changed Prefix to D2 where Id = 1 in CurrentList. D1 is there is DB and but not in CurrentList so i need to delete it. So i need to change the status to DELETE for that record. I should not insert D2 record where id=1 becuase D2 is already there. If I changed to D5 where Id = 1 then I need to insert it because D5 is not there in DB So i need to change the status to UPDATE.

How to do this? What is the best approach to compare lists


modified 9-Apr-19 22:26pm.

AnswerRe: Compare Two Complex List of data Pin
Gerry Schmitz10-Apr-19 6:55
mveGerry Schmitz10-Apr-19 6:55 
QuestionRe: Compare Two Complex List of data Pin
Maciej Los10-Apr-19 10:27
protectorMaciej Los10-Apr-19 10:27 
QuestionHow to update my list1 property value by list2 property value by joining Pin
Mou_kol9-Apr-19 9:42
memberMou_kol9-Apr-19 9:42 
AnswerRe: How to update my list1 property value by list2 property value by joining Pin
Eddy Vluggen10-Apr-19 0:21
mveEddy Vluggen10-Apr-19 0:21 
QuestionHow to equi join and left join between 3 List<t> Pin
Mou_kol9-Apr-19 9:41
memberMou_kol9-Apr-19 9:41 
QuestionApplication Server and Connection Method Pin
mikiz8-Apr-19 21:30
membermikiz8-Apr-19 21:30 
AnswerRe: Application Server and Connection Method Pin
Pete O'Hanlon9-Apr-19 1:22
protectorPete O'Hanlon9-Apr-19 1:22 
AnswerRe: Application Server and Connection Method Pin
Eddy Vluggen9-Apr-19 1:53
mveEddy Vluggen9-Apr-19 1:53 
GeneralRe: Application Server and Connection Method Pin
mikiz9-Apr-19 4:13
membermikiz9-Apr-19 4:13 
GeneralRe: Application Server and Connection Method Pin
Dave Kreskowiak9-Apr-19 4:36
mveDave Kreskowiak9-Apr-19 4:36 
GeneralRe: Application Server and Connection Method Pin
Eddy Vluggen9-Apr-19 5:48
mveEddy Vluggen9-Apr-19 5:48 
AnswerRe: Application Server and Connection Method Pin
Dave Kreskowiak9-Apr-19 3:05
mveDave Kreskowiak9-Apr-19 3:05 
GeneralRe: Application Server and Connection Method Pin
mikiz9-Apr-19 4:02
membermikiz9-Apr-19 4:02 
GeneralRe: Application Server and Connection Method Pin
Eddy Vluggen9-Apr-19 8:56
mveEddy Vluggen9-Apr-19 8:56 
GeneralRe: Application Server and Connection Method Pin
Dave Kreskowiak9-Apr-19 9:22
mveDave Kreskowiak9-Apr-19 9:22 
GeneralRe: Application Server and Connection Method Pin
Eddy Vluggen9-Apr-19 9:28
mveEddy Vluggen9-Apr-19 9:28 
AnswerRe: Application Server and Connection Method Pin
Gerry Schmitz9-Apr-19 5:58
mveGerry Schmitz9-Apr-19 5:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.