Click here to Skip to main content
15,905,566 members
Home / Discussions / C#
   

C#

 
QuestionBackgroundWorker with anonymous methods ? Pin
Mohammad Dayyan16-Jan-10 4:06
Mohammad Dayyan16-Jan-10 4:06 
AnswerRe: BackgroundWorker with anonymous methods ? Pin
Nicholas Butler16-Jan-10 4:59
sitebuilderNicholas Butler16-Jan-10 4:59 
GeneralRe: BackgroundWorker with anonymous methods ? Pin
Mohammad Dayyan16-Jan-10 6:58
Mohammad Dayyan16-Jan-10 6:58 
QuestionHolding data in memory Pin
Bardy8516-Jan-10 0:22
Bardy8516-Jan-10 0:22 
AnswerRe: Holding data in memory Pin
OriginalGriff16-Jan-10 1:01
mveOriginalGriff16-Jan-10 1:01 
GeneralRe: Holding data in memory Pin
Bardy8516-Jan-10 1:16
Bardy8516-Jan-10 1:16 
GeneralRe: Holding data in memory Pin
N a v a n e e t h16-Jan-10 6:05
N a v a n e e t h16-Jan-10 6:05 
GeneralRe: Holding data in memory Pin
Dan Mos16-Jan-10 7:21
Dan Mos16-Jan-10 7:21 
Bardy85 wrote:
Tools.DB.OL.Xtime.EMPLOYEE employee = new Tools.DB.OL.Xtime.EMPLOYEE(); if (listEMPLOYEE.Exists(p)) { employee = listEMPLOYEE.Find(p); } return employee;


If you're going to keep it as a in memory List, then I think the best otion/performance
is to derive your class from IComparable<employee> and then use binary search.

something like:

public class Person: IComparable(Person){
    private string name="";
    private string ocupation="";
      
    public string Name{
      get{return name;}
      set{name=value;}
    }
    .
    .
    .
    //implement IComparable
    public int CompareTo(Person other){
        return this.name.CompareTo(other.name);
    }
}

//now somewhere fill a List of Persons
      List(Person) persons = Utils.StoredProcs.PersonProcs.GetPersons();
      
      //and use binary search witch is very fast
      Person p = persons[
             persons.BinarySearch(new Person{Name="Some Name"})];
      //Do something with the rest of fields/data
      
      // Binary Search has O(n) = log (n); Of course you need to Order the data
      //I'm retriving it already oreder by the Select(s) statements/procs


I actually implemented a Reporting program this way. It's blazing fast.
Faster then our "entity" server. Memory consumption is like 170MB for a hole year worth of data.
//And there are tens of milions rows of data from over 10 tables/classes.

Botom line: if your app is to be run by a well established nr of users within your "entity"/firm/enterprise/whatever then go for it.
Try using StoredProcs instead of string commands => significant speed gains.


GeneralRe: Holding data in memory Pin
Bardy8516-Jan-10 9:21
Bardy8516-Jan-10 9:21 
GeneralRe: Holding data in memory Pin
Luc Pattyn16-Jan-10 10:05
sitebuilderLuc Pattyn16-Jan-10 10:05 
GeneralRe: Holding data in memory Pin
Bardy8516-Jan-10 10:56
Bardy8516-Jan-10 10:56 
GeneralRe: Holding data in memory [modified] Pin
Dan Mos16-Jan-10 11:01
Dan Mos16-Jan-10 11:01 
GeneralRe: Holding data in memory Pin
Bardy8516-Jan-10 9:28
Bardy8516-Jan-10 9:28 
GeneralRe: Holding data in memory Pin
Dan Mos16-Jan-10 10:48
Dan Mos16-Jan-10 10:48 
QuestionSystem.Drawing.Graphics Problem Pin
logicon15-Jan-10 23:17
logicon15-Jan-10 23:17 
AnswerRe: System.Drawing.Graphics Problem Pin
OriginalGriff15-Jan-10 23:34
mveOriginalGriff15-Jan-10 23:34 
GeneralRe: System.Drawing.Graphics Problem Pin
logicon16-Jan-10 0:38
logicon16-Jan-10 0:38 
GeneralRe: System.Drawing.Graphics Problem Pin
OriginalGriff16-Jan-10 0:54
mveOriginalGriff16-Jan-10 0:54 
QuestionAdd an Item to a ListView in VitualMode ? Pin
Mohammad Dayyan15-Jan-10 22:48
Mohammad Dayyan15-Jan-10 22:48 
AnswerRe: Add an Item to a ListView in VitualMode ? Pin
MumbleB16-Jan-10 5:41
MumbleB16-Jan-10 5:41 
GeneralRe: Add an Item to a ListView in VitualMode ? Pin
Mohammad Dayyan16-Jan-10 6:52
Mohammad Dayyan16-Jan-10 6:52 
QuestionDirectX Support In C#.Net Pin
ashwath197915-Jan-10 20:10
ashwath197915-Jan-10 20:10 
AnswerMessage Closed Pin
15-Jan-10 20:49
stancrm15-Jan-10 20:49 
GeneralRe: DirectX Support In C#.Net Pin
ashwath197916-Jan-10 0:32
ashwath197916-Jan-10 0:32 
GeneralMessage Closed Pin
16-Jan-10 1:02
stancrm16-Jan-10 1:02 

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.