Click here to Skip to main content
15,925,661 members
Home / Discussions / C#
   

C#

 
Questionc# covert a for loop to for each (arraylist) Pin
Aindriu Mac Giolla Eoin27-Apr-15 9:29
Aindriu Mac Giolla Eoin27-Apr-15 9:29 
GeneralRe: c# covert a for loop to for each (arraylist) Pin
PIEBALDconsult27-Apr-15 9:39
mvePIEBALDconsult27-Apr-15 9:39 
GeneralRe: c# covert a for loop to for each (arraylist) Pin
Aindriu Mac Giolla Eoin27-Apr-15 9:42
Aindriu Mac Giolla Eoin27-Apr-15 9:42 
AnswerRe: c# covert a for loop to for each (arraylist) Pin
Richard Deeming27-Apr-15 10:17
mveRichard Deeming27-Apr-15 10:17 
GeneralRe: c# covert a for loop to for each (arraylist) Pin
Aindriu Mac Giolla Eoin27-Apr-15 10:28
Aindriu Mac Giolla Eoin27-Apr-15 10:28 
AnswerRe: c# covert a for loop to for each (arraylist) Pin
Marjan Venema30-Apr-15 8:02
professionalMarjan Venema30-Apr-15 8:02 
QuestionC# Datepicker value not saved in MySql database Pin
ahmed_one27-Apr-15 0:20
ahmed_one27-Apr-15 0:20 
AnswerRe: C# Datepicker value not saved in MySql database Pin
Gerry Schmitz27-Apr-15 19:47
mveGerry Schmitz27-Apr-15 19:47 
GeneralRe: C# Datepicker value not saved in MySql database Pin
ahmed_one27-Apr-15 20:26
ahmed_one27-Apr-15 20:26 
GeneralRe: C# Datepicker value not saved in MySql database Pin
Gerry Schmitz27-Apr-15 20:56
mveGerry Schmitz27-Apr-15 20:56 
GeneralRe: C# Datepicker value not saved in MySql database Pin
ahmed_one27-Apr-15 21:02
ahmed_one27-Apr-15 21:02 
GeneralRe: C# Datepicker value not saved in MySql database Pin
Gerry Schmitz27-Apr-15 21:33
mveGerry Schmitz27-Apr-15 21:33 
GeneralRe: C# Datepicker value not saved in MySql database Pin
ahmed_one28-Apr-15 3:40
ahmed_one28-Apr-15 3:40 
GeneralRe: C# Datepicker value not saved in MySql database Pin
ahmed_one28-Apr-15 4:18
ahmed_one28-Apr-15 4:18 
GeneralRe: C# Datepicker value not saved in MySql database Pin
Gerry Schmitz28-Apr-15 9:14
mveGerry Schmitz28-Apr-15 9:14 
QuestionWhat is Constructor Overloading in C# .net ? Pin
dhivya.sakthi26-Apr-15 20:35
dhivya.sakthi26-Apr-15 20:35 
AnswerRe: What is Constructor Overloading in C# .net ? Pin
OriginalGriff26-Apr-15 21:28
mveOriginalGriff26-Apr-15 21:28 
AnswerRe: What is Constructor Overloading in C# .net ? Pin
Dr Gadgit27-Apr-15 3:43
Dr Gadgit27-Apr-15 3:43 
AnswerRe: What is Constructor Overloading in C# .net ? Pin
David A. Gray3-May-15 10:19
David A. Gray3-May-15 10:19 
QuestionVideo cutter / merger in C# winfrom Pin
Member 1162007426-Apr-15 7:35
Member 1162007426-Apr-15 7:35 
GeneralRe: Video cutter / merger in C# winfrom Pin
Sascha Lefèvre26-Apr-15 7:46
professionalSascha Lefèvre26-Apr-15 7:46 
QuestionSql Dependency onchange event not firing every time c# Pin
Tridip Bhattacharjee25-Apr-15 9:56
professionalTridip Bhattacharjee25-Apr-15 9:56 
AnswerRe: Sql Dependency onchange event not firing every time c# Pin
Dave Kreskowiak25-Apr-15 10:55
mveDave Kreskowiak25-Apr-15 10:55 
Questionc# opening database to array Pin
ruspj25-Apr-15 8:03
ruspj25-Apr-15 8:03 
AnswerRe: c# opening database to array Pin
Sascha Lefèvre25-Apr-15 8:16
professionalSascha Lefèvre25-Apr-15 8:16 
A DataReader only allows for reading the result-set once. Where you count the lines with while (reader.Read()) {rows++;}; you're advancing the position of the DataReader to the end of the result-set and then it considers its job done, no further reading possible.

Instead of an array (for which you have to know the size in order to allocate it) just use a List (for which you don't have to know the amount of items beforehand). And I would suggest to create a class with the columns you're reading as properties, to use it as the items for the List.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

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.