Click here to Skip to main content
16,013,082 members
Home / Discussions / C#
   

C#

 
GeneralRe: Hide application from process list? Pin
BoneSoft26-Jun-06 14:42
BoneSoft26-Jun-06 14:42 
GeneralRe: Hide application from process list? Pin
Jun Du26-Jun-06 14:02
Jun Du26-Jun-06 14:02 
GeneralRe: Hide application from process list? Pin
Dave Kreskowiak26-Jun-06 17:41
mveDave Kreskowiak26-Jun-06 17:41 
QuestionGet Attribute Fuction Pin
Pantelis1326-Jun-06 7:30
Pantelis1326-Jun-06 7:30 
AnswerRe: Get Attribute Fuction Pin
Not Active26-Jun-06 8:26
mentorNot Active26-Jun-06 8:26 
QuestionHelp with textfile loop Pin
giulione26-Jun-06 7:26
giulione26-Jun-06 7:26 
AnswerRe: Help with textfile loop Pin
Stefan Troschuetz26-Jun-06 7:38
Stefan Troschuetz26-Jun-06 7:38 
AnswerRe: Help with textfile loop Pin
Guffa26-Jun-06 7:52
Guffa26-Jun-06 7:52 
You never change the "conta" variable, so it will always be zero. As (0 % 4) is zero, the condition in the if statement is always true. As you only have one string in the ArrayList when you enter the code in the if statement, the expression "lines[1]" will get you an "index out of range" error.

When you fix that, you will notice that you save the same data over and over again. That is because you never clear the ArrayList.

Furtermore:

You should open and close the database connection outside the loop, otherwise the loop will get rather slow if you get more than a few records.

Try to use variable names that are a bit more descriptive than "a", "b", "c", "d".

You should use a parameterized query instead of concatenating the strings into it. If you don't want to do that, you should encode the string correctly for SQL by replacing apostrophes (') in them with double apostrophes.


---
b { font-weight: normal; }

QuestionHow can I show a contextMenuStrip when a user right click a mainMenuStrip item? Pin
AngryC26-Jun-06 6:29
AngryC26-Jun-06 6:29 
AnswerRe: How can I show a contextMenuStrip when a user right click a mainMenuStrip item? Pin
Judah Gabriel Himango26-Jun-06 7:23
sponsorJudah Gabriel Himango26-Jun-06 7:23 
GeneralRe: How can I show a contextMenuStrip when a user right click a mainMenuStrip item? Pin
AngryC26-Jun-06 7:49
AngryC26-Jun-06 7:49 
GeneralRe: How can I show a contextMenuStrip when a user right click a mainMenuStrip item? Pin
Nader Elshehabi26-Jun-06 8:08
Nader Elshehabi26-Jun-06 8:08 
GeneralRe: How can I show a contextMenuStrip when a user right click a mainMenuStrip item? Pin
AngryC26-Jun-06 12:08
AngryC26-Jun-06 12:08 
GeneralRe: How can I show a contextMenuStrip when a user right click a mainMenuStrip item? Pin
Nader Elshehabi26-Jun-06 13:21
Nader Elshehabi26-Jun-06 13:21 
QuestionFree open source Rich Text Editor Pin
NaNg1524126-Jun-06 5:31
NaNg1524126-Jun-06 5:31 
AnswerRe: Free open source Rich Text Editor Pin
Steve Maier26-Jun-06 5:58
professionalSteve Maier26-Jun-06 5:58 
AnswerRe: Free open source Rich Text Editor Pin
J4amieC26-Jun-06 6:06
J4amieC26-Jun-06 6:06 
AnswerRe: Free open source Rich Text Editor Pin
Graham Nimbley26-Jun-06 8:42
Graham Nimbley26-Jun-06 8:42 
QuestionUrgent Pin
Shiv526-Jun-06 5:19
Shiv526-Jun-06 5:19 
AnswerRe: Urgent Pin
J4amieC26-Jun-06 5:34
J4amieC26-Jun-06 5:34 
AnswerRe: Urgent Pin
Judah Gabriel Himango26-Jun-06 5:52
sponsorJudah Gabriel Himango26-Jun-06 5:52 
AnswerRe: Urgent Pin
Colin Angus Mackay26-Jun-06 5:58
Colin Angus Mackay26-Jun-06 5:58 
AnswerRe: Urgent Pin
Jun Du26-Jun-06 6:03
Jun Du26-Jun-06 6:03 
GeneralRe: Urgent Pin
[DK]KiloDunse26-Jun-06 7:49
[DK]KiloDunse26-Jun-06 7:49 
AnswerRe: Urgent Pin
Dave Kreskowiak26-Jun-06 9:04
mveDave Kreskowiak26-Jun-06 9:04 

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.