Click here to Skip to main content
15,893,381 members
Home / Discussions / C#
   

C#

 
AnswerCROSS POST Pin
dan!sh 27-Jun-09 23:51
professional dan!sh 27-Jun-09 23:51 
AnswerKey-logger Pin
fly90428-Jun-09 0:10
fly90428-Jun-09 0:10 
QuestionRe: keystroke monitor Pin
musefan29-Jun-09 2:45
musefan29-Jun-09 2:45 
AnswerRe: keystroke monitor Pin
EliottA29-Jun-09 3:32
EliottA29-Jun-09 3:32 
QuestionConnection Of Database during installing SETUP Pin
rhtbhegade27-Jun-09 20:32
rhtbhegade27-Jun-09 20:32 
AnswerRe: Connection Of Database during installing SETUP Pin
Arindam Sinha27-Jun-09 22:18
Arindam Sinha27-Jun-09 22:18 
QuestionUnable to Save Array values in database Pin
googlejumbo27-Jun-09 19:24
googlejumbo27-Jun-09 19:24 
AnswerRe: Unable to Save Array values in database Pin
Henry Minute28-Jun-09 8:01
Henry Minute28-Jun-09 8:01 
You should declare the parameters outside the for loop. e.g.

change:
sqlInsertCmd.Parameters.AddWithValue("@BezierCusp",val);


to:
sqlInsertCmd.Parameters.Add("@BezierCusp", SqlDbType.whatever); // There are several overloads of this method, pick one that suits


and move it outside of the for loop.

Then in its place put
// Note the syntax might not be exact here, I'm doing it from memory, but there are loads of examples on MSDN and elsewhere
sqlInsertCmd.Parameters["@BezierCusp"].Value = val;


The error message you are getting is really quite accurate, it is simply telling you that you have already declared @BezierCusp and therefore can't do so again. Which is what your code tries to do on every iteration of the loop, after the first one.

Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

GeneralRe: Unable to Save Array values in database Pin
googlejumbo28-Jun-09 20:24
googlejumbo28-Jun-09 20:24 
GeneralRe: Unable to Save Array values in database Pin
Henry Minute28-Jun-09 21:55
Henry Minute28-Jun-09 21:55 
GeneralRe: Unable to Save Array values in database Pin
googlejumbo28-Jun-09 22:22
googlejumbo28-Jun-09 22:22 
GeneralRe: Unable to Save Array values in database Pin
Henry Minute29-Jun-09 6:06
Henry Minute29-Jun-09 6:06 
QuestionLeading zero in hex formatting Pin
Trollslayer27-Jun-09 11:56
mentorTrollslayer27-Jun-09 11:56 
AnswerRe: Leading zero in hex formatting Pin
Christian Graus27-Jun-09 12:01
protectorChristian Graus27-Jun-09 12:01 
AnswerRe: Leading zero in hex formatting Pin
Ed.Poore27-Jun-09 12:01
Ed.Poore27-Jun-09 12:01 
GeneralRe: Leading zero in hex formatting Pin
Christian Graus27-Jun-09 12:18
protectorChristian Graus27-Jun-09 12:18 
GeneralRe: Leading zero in hex formatting Pin
Luc Pattyn27-Jun-09 12:31
sitebuilderLuc Pattyn27-Jun-09 12:31 
GeneralRe: Leading zero in hex formatting Pin
Christian Graus27-Jun-09 12:38
protectorChristian Graus27-Jun-09 12:38 
GeneralRe: Leading zero in hex formatting Pin
Ed.Poore27-Jun-09 14:01
Ed.Poore27-Jun-09 14:01 
GeneralRe: Leading zero in hex formatting Pin
Luc Pattyn27-Jun-09 15:07
sitebuilderLuc Pattyn27-Jun-09 15:07 
GeneralRe: Leading zero in hex formatting Pin
Ed.Poore27-Jun-09 23:47
Ed.Poore27-Jun-09 23:47 
GeneralRe: Leading zero in hex formatting Pin
Trollslayer27-Jun-09 13:53
mentorTrollslayer27-Jun-09 13:53 
GeneralRe: Leading zero in hex formatting Pin
Ed.Poore27-Jun-09 14:00
Ed.Poore27-Jun-09 14:00 
GeneralRe: Leading zero in hex formatting Pin
Trollslayer27-Jun-09 14:13
mentorTrollslayer27-Jun-09 14:13 
JokeRe: Leading zero in hex formatting Pin
Christian Graus27-Jun-09 14:21
protectorChristian Graus27-Jun-09 14:21 

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.