Click here to Skip to main content
15,911,707 members
Home / Discussions / C#
   

C#

 
AnswerRe: draw above a control? Pin
Rob Graham25-Oct-05 17:54
Rob Graham25-Oct-05 17:54 
GeneralRe: draw above a control? Pin
Longxe25-Oct-05 18:31
Longxe25-Oct-05 18:31 
Questionunicode Pin
ybasha25-Oct-05 16:15
ybasha25-Oct-05 16:15 
AnswerRe: unicode Pin
KaptinKrunch25-Oct-05 17:21
KaptinKrunch25-Oct-05 17:21 
GeneralRe: unicode Pin
ybasha25-Oct-05 17:30
ybasha25-Oct-05 17:30 
GeneralRe: unicode Pin
ybasha25-Oct-05 17:32
ybasha25-Oct-05 17:32 
AnswerRe: unicode Pin
Christian Graus25-Oct-05 17:35
protectorChristian Graus25-Oct-05 17:35 
AnswerRe: unicode Pin
Rob Graham25-Oct-05 17:40
Rob Graham25-Oct-05 17:40 
Since you didn't cut an paste the real code (as evidinced by the incomplete for statement) it is possible that the error message is correct: Var1 doesn't exist in the posted code. its var1... C# is after all case sensitive...

This would be better done as a parameterized query anyway. Parameters have fewer issues with text characters (don't mind unescaped single quotes for instance) and so are less likely to give strange errors than dynamically built SQL.

I notice that two or more of your replacements are replaceing unicode characters with double quotes, which likely totally corrupt the concatenated query sting (causing it to appear to terminate early). Using parameters would avoid that issue as well.

Christian's observation is also likely a problem, and is another that would be avoided by using parameters.

Building up SQL statements by concatenating stuff like this is bad practice for a number of reasons (increased garbage generation from all the string reallocations, vulnerability to SQL injection attack, etc).

[edit] On top of all that, all the string variables (var1, var2, etc) are declared inside the scope of the for loop, and so do not exist outside of it (where your sql sting is declared and concatenated)...move the declarations to before the for loop, and this might have a chance [edit]

Absolute faith corrupts as absolutely as absolute power
Eric Hoffer

All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke



-- modified at 0:00 Wednesday 26th October, 2005
AnswerRe: unicode Pin
Anonymous25-Oct-05 17:41
Anonymous25-Oct-05 17:41 
AnswerRe: unicode Pin
Gulfraz Khan27-Oct-05 5:31
Gulfraz Khan27-Oct-05 5:31 
AnswerRe: unicode Pin
lmoelleb27-Oct-05 11:16
lmoelleb27-Oct-05 11:16 
Questionwriting a C#program(arrays) Pin
Zjaded25-Oct-05 13:19
Zjaded25-Oct-05 13:19 
AnswerRe: writing a C#program(arrays) Pin
Christian Graus25-Oct-05 13:25
protectorChristian Graus25-Oct-05 13:25 
AnswerRe: writing a C#program(arrays) Pin
Guffa25-Oct-05 13:25
Guffa25-Oct-05 13:25 
GeneralRe: writing a C#program(arrays) Pin
Zjaded25-Oct-05 13:37
Zjaded25-Oct-05 13:37 
GeneralRe: writing a C#program(arrays) Pin
David Stone25-Oct-05 13:59
sitebuilderDavid Stone25-Oct-05 13:59 
GeneralOT Pin
leppie25-Oct-05 22:30
leppie25-Oct-05 22:30 
GeneralRe: OT Pin
David Stone26-Oct-05 11:11
sitebuilderDavid Stone26-Oct-05 11:11 
GeneralRe: writing a C#program(arrays) Pin
Zjaded26-Oct-05 10:18
Zjaded26-Oct-05 10:18 
GeneralRe: writing a C#program(arrays) Pin
Wjousts26-Oct-05 13:00
Wjousts26-Oct-05 13:00 
GeneralRe: writing a C#program(arrays) Pin
Christian Graus25-Oct-05 14:00
protectorChristian Graus25-Oct-05 14:00 
QuestionQuestion about draw method (basic question) Pin
Green Fuze25-Oct-05 13:14
Green Fuze25-Oct-05 13:14 
AnswerRe: Question about draw method (basic question) Pin
Christian Graus25-Oct-05 13:25
protectorChristian Graus25-Oct-05 13:25 
GeneralRe: Question about draw method (basic question) Pin
Green Fuze25-Oct-05 13:55
Green Fuze25-Oct-05 13:55 
GeneralRe: Question about draw method (basic question) Pin
Green Fuze25-Oct-05 14:08
Green Fuze25-Oct-05 14:08 

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.