Click here to Skip to main content
16,004,969 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Updating dataset Pin
barnamehnevis_vbnet30-Apr-06 23:46
barnamehnevis_vbnet30-Apr-06 23:46 
GeneralRe: Updating dataset Pin
Radiska1-May-06 11:47
Radiska1-May-06 11:47 
GeneralRe: Updating dataset Pin
Chatura Dilan1-May-06 17:08
Chatura Dilan1-May-06 17:08 
QuestionOLEDbCommand Locks entire Access Db Pin
jcrussell30-Apr-06 17:09
jcrussell30-Apr-06 17:09 
QuestionLogoff/logon in windows, app still running, change user Pin
B*C30-Apr-06 14:36
B*C30-Apr-06 14:36 
AnswerRe: Logoff/logon in windows, app still running, change user Pin
B*C1-May-06 4:25
B*C1-May-06 4:25 
QuestionHelp displaying a structure in a sortedlist Pin
crash89330-Apr-06 11:18
crash89330-Apr-06 11:18 
AnswerRe: Help displaying a structure in a sortedlist Pin
Robert Rohde30-Apr-06 22:22
Robert Rohde30-Apr-06 22:22 
Hi,

in the SortedList the keys are the one you are sorting after, so in this case you sort by username and not by department. You can also access the structures rather quick (binary search algorithm) via the username:
MyStructure structure = (MyStructure)sortedList["username1"];

You shouldn't use the SortedList in this case. You could just create a normal Array of your structures
(MyStructure[]) and sort it:
MyStructure[] structures = CalcStructures();
Array.Sort(structures, new MyStructComparator);
//now the array is sorted

public class MyStructComparator : IComparer {
   public int Compare(object obj1, object obj2) {
      return ((MyStructure)obj1).Department.CompareTo(((MyStructure)obj2).Department);
   }
}

Now you could also easiliy add as much properties as you like and sort them accordingly.
GeneralRe: Help displaying a structure in a sortedlist Pin
crash8931-May-06 7:31
crash8931-May-06 7:31 
GeneralRe: Help displaying a structure in a sortedlist Pin
crash8931-May-06 7:37
crash8931-May-06 7:37 
GeneralRe: Help displaying a structure in a sortedlist Pin
Robert Rohde1-May-06 20:12
Robert Rohde1-May-06 20:12 
QuestionMS office connections Pin
DoubleD82230-Apr-06 10:59
DoubleD82230-Apr-06 10:59 
QuestionHi , please help me Pin
Mohammed Amine30-Apr-06 6:27
Mohammed Amine30-Apr-06 6:27 
GeneralRe: Hi , please help me Pin
Guffa30-Apr-06 7:13
Guffa30-Apr-06 7:13 
AnswerRe: Hi , please help me Pin
Colin Angus Mackay30-Apr-06 21:07
Colin Angus Mackay30-Apr-06 21:07 
Questionwhat is behind this label ?? ;p Pin
Mohammed Amine30-Apr-06 5:56
Mohammed Amine30-Apr-06 5:56 
AnswerRe: what is behind this label ?? ;p Pin
_mubashir30-Apr-06 21:44
_mubashir30-Apr-06 21:44 
GeneralRe: what is behind this label ?? ;p Pin
Mohammed Amine1-May-06 0:47
Mohammed Amine1-May-06 0:47 
Questionprint out IN VB.NET 1.1 Pin
pankajgarg1230-Apr-06 4:59
pankajgarg1230-Apr-06 4:59 
AnswerRe: print out IN VB.NET 1.1 Pin
Dave Kreskowiak30-Apr-06 5:17
mveDave Kreskowiak30-Apr-06 5:17 
QuestionMove file to Directory Pin
lo_ol30-Apr-06 4:19
lo_ol30-Apr-06 4:19 
AnswerRe: Move file to Directory Pin
Dave Kreskowiak30-Apr-06 5:20
mveDave Kreskowiak30-Apr-06 5:20 
GeneralRe: Move file to Directory Pin
lo_ol30-Apr-06 10:07
lo_ol30-Apr-06 10:07 
QuestionUsing an on-screen keypad Pin
Rumbo30-Apr-06 2:54
Rumbo30-Apr-06 2:54 
AnswerRe: Using an on-screen keypad Pin
Dave Kreskowiak30-Apr-06 5:13
mveDave Kreskowiak30-Apr-06 5:13 

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.