LINQ Help required
-
Hi , I have an application that will collect data from user (entering time sheet data) so the status of Time sheet can be any of the following 1. Open 2. Saved 3. submited 4. Under Review 5. Approvred. 6. Reject I am displaying a report on this data. Consider a case where user daily saving his time sheet but not submitting. My report will be like below Userid Date Status. 111 Date1 Open 111 Date1 Saved 111 Date1 Saved 111 Date2 Saved 111 Date3 Saved 111 Date4 Submitted 111 Date5 Under Review 111 Date6 Under Review 111 Date7 Under Review 111 Date7 Reject 111 Date7 Saved 111 Date7 Saved 111 Date7 submit : : Above are actual events done on the user time sheet . It looks like that duplicate data saved but it is displaying all the events. My requirement is to delete duplicate records if the current and previous records are having the same status . I can do his by looping through all the records using "for" by cecking previous and curent satus. But i want this is to be done in diffrent way, Can anyone suggest if we can use LINQ for this, if so please suggest me. Thanks,
-
Hi , I have an application that will collect data from user (entering time sheet data) so the status of Time sheet can be any of the following 1. Open 2. Saved 3. submited 4. Under Review 5. Approvred. 6. Reject I am displaying a report on this data. Consider a case where user daily saving his time sheet but not submitting. My report will be like below Userid Date Status. 111 Date1 Open 111 Date1 Saved 111 Date1 Saved 111 Date2 Saved 111 Date3 Saved 111 Date4 Submitted 111 Date5 Under Review 111 Date6 Under Review 111 Date7 Under Review 111 Date7 Reject 111 Date7 Saved 111 Date7 Saved 111 Date7 submit : : Above are actual events done on the user time sheet . It looks like that duplicate data saved but it is displaying all the events. My requirement is to delete duplicate records if the current and previous records are having the same status . I can do his by looping through all the records using "for" by cecking previous and curent satus. But i want this is to be done in diffrent way, Can anyone suggest if we can use LINQ for this, if so please suggest me. Thanks,
-
Hi , I have an application that will collect data from user (entering time sheet data) so the status of Time sheet can be any of the following 1. Open 2. Saved 3. submited 4. Under Review 5. Approvred. 6. Reject I am displaying a report on this data. Consider a case where user daily saving his time sheet but not submitting. My report will be like below Userid Date Status. 111 Date1 Open 111 Date1 Saved 111 Date1 Saved 111 Date2 Saved 111 Date3 Saved 111 Date4 Submitted 111 Date5 Under Review 111 Date6 Under Review 111 Date7 Under Review 111 Date7 Reject 111 Date7 Saved 111 Date7 Saved 111 Date7 submit : : Above are actual events done on the user time sheet . It looks like that duplicate data saved but it is displaying all the events. My requirement is to delete duplicate records if the current and previous records are having the same status . I can do his by looping through all the records using "for" by cecking previous and curent satus. But i want this is to be done in diffrent way, Can anyone suggest if we can use LINQ for this, if so please suggest me. Thanks,
You may be able to use linq but since you haven't indicated how or where this data is stored we can't give you a specific answer. With linq you can do joins and self joins that may be sufficient for you.
I know the language. I've read a book. - _Madmatt "The OP herself was not sure about her question" "The OP is from India and I know what she meant." - Shameel
-
So you want an explaination as to why this was marked as a bad answer? The OP asked
salmonraju wrote:
Can anyone suggest if we can use LINQ for this
and you reponded
Shameel wrote:
You don't need LINQ to do this
The question wasn't whether or not they needed LINQ for this is was IF it were possible to use LINQ. A bad answer since it did not answer the question that was posed.
Shameel wrote:
Plain SQL should do the trick.
The OP made no mention of how the data was being stored. Perhaps it was an in-memory datastore, an XML file, a flat file, etc. A bad answer since it made an unjustified assumption rather than ask for clarification. Now you have your explanation. You will no doubt disagree, that's you up to you. Now, leave it alone, go way, grow a thicker skin. Everyone else does not need to be subjected to your paranoia and sense of being pursecuted.
I know the language. I've read a book. - _Madmatt "The OP herself was not sure about her question" "The OP is from India and I know what she meant." - Shameel
modified on Tuesday, August 23, 2011 9:10 AM
-
So you want an explaination as to why this was marked as a bad answer? The OP asked
salmonraju wrote:
Can anyone suggest if we can use LINQ for this
and you reponded
Shameel wrote:
You don't need LINQ to do this
The question wasn't whether or not they needed LINQ for this is was IF it were possible to use LINQ. A bad answer since it did not answer the question that was posed.
Shameel wrote:
Plain SQL should do the trick.
The OP made no mention of how the data was being stored. Perhaps it was an in-memory datastore, an XML file, a flat file, etc. A bad answer since it made an unjustified assumption rather than ask for clarification. Now you have your explanation. You will no doubt disagree, that's you up to you. Now, leave it alone, go way, grow a thicker skin. Everyone else does not need to be subjected to your paranoia and sense of being pursecuted.
I know the language. I've read a book. - _Madmatt "The OP herself was not sure about her question" "The OP is from India and I know what she meant." - Shameel
modified on Tuesday, August 23, 2011 9:10 AM
Mark Nischalke wrote:
The question wasn't whether or not they needed LINQ for this is was IF it were possible to use LINQ.
IMO, a good professional is one who provides the best way to complete a task, not just what the OP asks for, and that is what I did. If there is problem with it, let the OP speak out, there's no need for you to keep pestering everyone here.
Mark Nischalke wrote:
The OP made no mention of how the data was being stored. Perhaps it was an in-memory datastore, an XML file, a flat file, etc. A bad answer since it made an unjustified assumption rather than ask for clarification.
To light up your short lived memory, you have a problem with asking for clarification too. Here's an example[^]. So it doesn't matter what I do, you need a reason to downvote me and you see an opportunity to do it in everything I post. I have no problem with it if that gives you satisfaction. Only a minion would do it and you never fail to prove that you are one.
Mark Nischalke wrote:
Now, leave it alone, go way, grow a thicker skin. Everyone else does not need to be subjected to your paranoia and sense of being pursecuted.
I did not litter your posts, it's the other way round, you came here uninvited and probably you should go away.
"Don't confuse experts with facts" - Eric_V
-
So you want an explaination as to why this was marked as a bad answer? The OP asked
salmonraju wrote:
Can anyone suggest if we can use LINQ for this
and you reponded
Shameel wrote:
You don't need LINQ to do this
The question wasn't whether or not they needed LINQ for this is was IF it were possible to use LINQ. A bad answer since it did not answer the question that was posed.
Shameel wrote:
Plain SQL should do the trick.
The OP made no mention of how the data was being stored. Perhaps it was an in-memory datastore, an XML file, a flat file, etc. A bad answer since it made an unjustified assumption rather than ask for clarification. Now you have your explanation. You will no doubt disagree, that's you up to you. Now, leave it alone, go way, grow a thicker skin. Everyone else does not need to be subjected to your paranoia and sense of being pursecuted.
I know the language. I've read a book. - _Madmatt "The OP herself was not sure about her question" "The OP is from India and I know what she meant." - Shameel
modified on Tuesday, August 23, 2011 9:10 AM
Mark Nischalke wrote:
sense of being pursecuted.
It's either: persecuted: Human english or purrsecuted: English transliteration of cat talk (I haven't yet come up with a witty translation of what a cat would try to express by this word) Cheers!
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925