Click here to Skip to main content
15,888,454 members
Home / Discussions / C#
   

C#

 
QuestionMultiple Record Insert Pin
shafiullah1237-Mar-09 1:19
shafiullah1237-Mar-09 1:19 
AnswerRe: Multiple Record Insert Pin
fly9047-Mar-09 8:23
fly9047-Mar-09 8:23 
QuestionChanging size of Array at Runtime Pin
nagendrathecoder7-Mar-09 1:11
nagendrathecoder7-Mar-09 1:11 
AnswerRe: Changing size of Array at Runtime Pin
Aghosh Babu7-Mar-09 1:19
Aghosh Babu7-Mar-09 1:19 
AnswerRe: Changing size of Array at Runtime Pin
nagendrathecoder7-Mar-09 1:24
nagendrathecoder7-Mar-09 1:24 
GeneralRe: Changing size of Array at Runtime Pin
Aghosh Babu7-Mar-09 1:30
Aghosh Babu7-Mar-09 1:30 
GeneralRe: Changing size of Array at Runtime Pin
nagendrathecoder7-Mar-09 1:34
nagendrathecoder7-Mar-09 1:34 
AnswerRe: Changing size of Array at Runtime Pin
Luc Pattyn7-Mar-09 1:42
sitebuilderLuc Pattyn7-Mar-09 1:42 
Hi,

In all .NET languages one-dimensional arrays can be resized, see the Array.Resize() method in the documentation. "This method allocates a new array with the specified size, copies elements from the old array to the new one, and then replaces the old array with the new one."

When you need to resize an array several times, or if you just don't know what size to choose at the start, you are probably better off choosing another kind of collection. The old ArrayList still exists, but it is better to use a generic list (that's List<T> ) which provides type checking and better performance. These collections grow and shrink dynamically without copying their content [ADDED] all the time (in the current implementation they grow by rounding up their capacity to the next power of 2 and copying only then).[/ADDED]

Smile | :)
Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


modified on Sunday, June 12, 2011 9:13 AM

GeneralRe: Changing size of Array at Runtime Pin
harold aptroot7-Mar-09 3:21
harold aptroot7-Mar-09 3:21 
AnswerRe: Changing size of Array at Runtime Pin
Luc Pattyn7-Mar-09 3:38
sitebuilderLuc Pattyn7-Mar-09 3:38 
QuestionHow to save application settings in .net C# CF? Pin
Aghosh Babu7-Mar-09 1:01
Aghosh Babu7-Mar-09 1:01 
AnswerRe: How to save application settings in .net C# CF? Pin
Natza Mitzi8-Mar-09 10:14
Natza Mitzi8-Mar-09 10:14 
GeneralRe: How to save application settings in .net C# CF? Pin
Aghosh Babu8-Mar-09 18:26
Aghosh Babu8-Mar-09 18:26 
GeneralRe: How to save application settings in .net C# CF? Pin
Natza Mitzi8-Mar-09 22:48
Natza Mitzi8-Mar-09 22:48 
Questionchange date format using c# Pin
Abdul Rahman Hamidy7-Mar-09 0:58
Abdul Rahman Hamidy7-Mar-09 0:58 
AnswerRe: change date format using c# Pin
Xmen Real 7-Mar-09 4:18
professional Xmen Real 7-Mar-09 4:18 
GeneralRe: change date format using c# Pin
Abdul Rahman Hamidy7-Mar-09 18:28
Abdul Rahman Hamidy7-Mar-09 18:28 
GeneralRe: change date format using c# [modified] Pin
Bishoy Rasmy17-Nov-09 23:25
Bishoy Rasmy17-Nov-09 23:25 
QuestionHow to create a wrapper class in c#.net? Pin
sreenivasaraok7-Mar-09 0:35
sreenivasaraok7-Mar-09 0:35 
AnswerRe: How to create a wrapper class in c#.net? Pin
Calin Tatar7-Mar-09 0:43
Calin Tatar7-Mar-09 0:43 
AnswerRe: How to create a wrapper class in c#.net? Pin
Christian Graus2-Jun-10 20:30
protectorChristian Graus2-Jun-10 20:30 
QuestionHow can I install a db schema while installing a program? Pin
dejmjin6-Mar-09 22:59
dejmjin6-Mar-09 22:59 
AnswerRe: How can I install a db schema while installing a program? Pin
Calin Tatar6-Mar-09 23:55
Calin Tatar6-Mar-09 23:55 
GeneralRe: How can I install a db schema while installing a program? Pin
dejmjin7-Mar-09 0:04
dejmjin7-Mar-09 0:04 
QuestionConvert a pdf file to picture format with hight quality Pin
abbd6-Mar-09 22:57
abbd6-Mar-09 22:57 

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.