Click here to Skip to main content
15,904,153 members
Home / Discussions / C#
   

C#

 
GeneralDelete childnodes and not rootnode using the checkbox in the Treeview property Pin
T4AMD27-Dec-07 9:11
T4AMD27-Dec-07 9:11 
GeneralRe: Delete childnodes and not rootnode using the checkbox in the Treeview property Pin
Paul Conrad27-Dec-07 15:02
professionalPaul Conrad27-Dec-07 15:02 
GeneralPrint on MobileProSpectrum Printer using WindowsCE5.0 device in .NET2005 Pin
michaelqog27-Dec-07 9:10
michaelqog27-Dec-07 9:10 
QuestionParsing one PDF out to several PDFs Pin
franzcatch27-Dec-07 7:50
franzcatch27-Dec-07 7:50 
GeneralRe: Parsing one PDF out to several PDFs Pin
Jimmanuel27-Dec-07 8:28
Jimmanuel27-Dec-07 8:28 
QuestionByte to Hex string Pin
piyush123027-Dec-07 4:27
piyush123027-Dec-07 4:27 
GeneralRe: Byte to Hex string Pin
Luc Pattyn27-Dec-07 4:55
sitebuilderLuc Pattyn27-Dec-07 4:55 
GeneralRe: Byte to Hex string Pin
Guffa27-Dec-07 9:32
Guffa27-Dec-07 9:32 
piyush1230 wrote:
and append to string


You can't append anything to a string. Strings are immutable, so if you add something to the end of a string, a completely new string object is created and the data is copied to the new object. If you do this in a loop, it scales very badly. Each iteration roughly doubles the execution time, so it gets very bad very fast.

Use a StringBuilder to create the string:

StringBuilder builder = new StringBuilder(someArray.Length * 2);
foreach (byte b in someArray) {
   builder.Append(b.ToString("x2"));
}
string hexString = builder.ToString();


Experience is the sum of all the mistakes you have done.

GeneralRe: Byte to Hex string Pin
piyush123027-Dec-07 17:26
piyush123027-Dec-07 17:26 
Questionto create strong name in VS 2005 in command prompt Pin
Dhilipkumar27-Dec-07 4:05
Dhilipkumar27-Dec-07 4:05 
GeneralRe: to create strong name in VS 2005 in command prompt Pin
TJoe27-Dec-07 5:20
TJoe27-Dec-07 5:20 
GeneralUpdating mdb file from another mdb file Pin
kallileo27-Dec-07 3:20
kallileo27-Dec-07 3:20 
GeneralRe: Updating mdb file from another mdb file Pin
Not Active27-Dec-07 3:53
mentorNot Active27-Dec-07 3:53 
GeneralRe: Updating mdb file from another mdb file Pin
kallileo27-Dec-07 4:03
kallileo27-Dec-07 4:03 
Answer[Message Deleted] Pin
Catherine8827-Dec-07 3:18
Catherine8827-Dec-07 3:18 
GeneralRe: Urgent help needed for project Pin
Colin Angus Mackay27-Dec-07 3:48
Colin Angus Mackay27-Dec-07 3:48 
GeneralRe: Urgent help needed for project Pin
Not Active27-Dec-07 3:52
mentorNot Active27-Dec-07 3:52 
GeneralRe: Urgent help needed for project Pin
Paul Conrad27-Dec-07 6:26
professionalPaul Conrad27-Dec-07 6:26 
QuestionHow can I implement a Brush property for a control? Pin
ctoma200527-Dec-07 2:56
ctoma200527-Dec-07 2:56 
AnswerRe: How can I implement a Brush property for a control? Pin
TJoe27-Dec-07 5:09
TJoe27-Dec-07 5:09 
GeneralRe: How can I implement a Brush property for a control? Pin
ctoma200528-Dec-07 2:31
ctoma200528-Dec-07 2:31 
GeneralRe: How can I implement a Brush property for a control? Pin
TJoe28-Dec-07 3:41
TJoe28-Dec-07 3:41 
Questioncapture Data Modified from database real time? Pin
jason_mf27-Dec-07 2:25
jason_mf27-Dec-07 2:25 
AnswerRe: capture Data Modified from database real time? Pin
Giorgi Dalakishvili27-Dec-07 2:42
mentorGiorgi Dalakishvili27-Dec-07 2:42 
GeneralRe: capture Data Modified from database real time? Pin
jason_mf27-Dec-07 3:02
jason_mf27-Dec-07 3: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.