Click here to Skip to main content
15,900,815 members
Home / Discussions / C#
   

C#

 
QuestionDataSet/DataTable to .dbf convertion Pin
Nagendra Gunaga19-Jun-06 18:59
Nagendra Gunaga19-Jun-06 18:59 
NewsQQ group for Wuhan-China's programer Pin
whChina19-Jun-06 17:12
whChina19-Jun-06 17:12 
GeneralRe: QQ group for Wuhan-China's programer Pin
whChina20-Jun-06 23:27
whChina20-Jun-06 23:27 
QuestionMultiplatform (32bits/64bits/CE) & Interop Pin
Super Lloyd19-Jun-06 16:16
Super Lloyd19-Jun-06 16:16 
AnswerRe: Multiplatform (32bits/64bits/CE) & Interop Pin
leppie19-Jun-06 22:01
leppie19-Jun-06 22:01 
GeneralRe: Multiplatform (32bits/64bits/CE) & Interop Pin
Super Lloyd19-Jun-06 22:13
Super Lloyd19-Jun-06 22:13 
GeneralRe: Multiplatform (32bits/64bits/CE) & Interop Pin
Super Lloyd19-Jun-06 22:17
Super Lloyd19-Jun-06 22:17 
GeneralRe: Multiplatform (32bits/64bits/CE) & Interop Pin
Super Lloyd20-Jun-06 5:40
Super Lloyd20-Jun-06 5:40 
QuestionXSL:, XMLDOM C# Pin
Ramon Gzz M19-Jun-06 16:10
Ramon Gzz M19-Jun-06 16:10 
QuestionMicrosoft Word/Excel Automation Errors [modified] Pin
dbloch19-Jun-06 15:19
dbloch19-Jun-06 15:19 
QuestionUser settings for application Pin
Mike0919-Jun-06 14:27
Mike0919-Jun-06 14:27 
AnswerRe: User settings for application Pin
Mike Poz19-Jun-06 15:03
Mike Poz19-Jun-06 15:03 
QuestionHow to get distinct items from an array? Pin
mejobloggs19-Jun-06 13:34
mejobloggs19-Jun-06 13:34 
AnswerRe: How to get distinct items from an array? Pin
Alexander Wiseman19-Jun-06 14:04
Alexander Wiseman19-Jun-06 14:04 
There a couple of ways you could attack this, depending on speed and space considerations. Here they are theoretically:

1) Sort the array list, then go through and call ArrayList.RemoveAt to chop out any duplicates in a simple loop through the sorted array.

2) Copy the ArrayList over to another ArrayList item by item, but each time, before you add an item, call ArrayList.Contains to check if the NEW array already contains the value you are trying to add from the OLD array.

3) Copy the ArrayList over to a Hashtable item by item, making the key the items in your array, and each time call Hashtable.ContainsKey to check if you've already added a value from the array.

These were a couple of the ways I could think of. There are probably others and more efficient, but these will get the job done. I wouldn't recommend using number 3 unless time is a real consideration. Number 2 is going to take much longer if you have a long array, because this will be looping through the array as many times as you have items. Number 1 can be longer or shorter depending on the sort algorithm you have.

Hope that helps!

Sincerely,
Alexander Wiseman
GeneralRe: How to get distinct items from an array? Pin
mejobloggs19-Jun-06 15:57
mejobloggs19-Jun-06 15:57 
GeneralRe: How to get distinct items from an array? Pin
leppie19-Jun-06 22:07
leppie19-Jun-06 22:07 
GeneralRe: How to get distinct items from an array? Pin
Alexander Wiseman20-Jun-06 5:43
Alexander Wiseman20-Jun-06 5:43 
AnswerRe: How to get distinct items from an array? Pin
Leslie Sanford19-Jun-06 16:43
Leslie Sanford19-Jun-06 16:43 
GeneralRe: How to get distinct items from an array? Pin
mejobloggs19-Jun-06 17:09
mejobloggs19-Jun-06 17:09 
AnswerRe: How to get distinct items from an array? Pin
Judah Gabriel Himango19-Jun-06 18:22
sponsorJudah Gabriel Himango19-Jun-06 18:22 
QuestionProcess.Start() mailto exception - default mail client Pin
stretchtack19-Jun-06 13:11
stretchtack19-Jun-06 13:11 
AnswerRe: Process.Start() mailto exception - default mail client Pin
Alexander Wiseman19-Jun-06 13:54
Alexander Wiseman19-Jun-06 13:54 
GeneralRe: Process.Start() mailto exception - default mail client Pin
stretchtack19-Jun-06 19:20
stretchtack19-Jun-06 19:20 
GeneralSTAThread vs. MTAThread - Process.Start() Pin
stretchtack20-Jun-06 7:28
stretchtack20-Jun-06 7:28 
GeneralRe: STAThread vs. MTAThread - Process.Start() Pin
Alexander Wiseman20-Jun-06 8:46
Alexander Wiseman20-Jun-06 8:46 

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.