SQL Parameter bug

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having a function which accepts Database parameter array, and it
inserts to the database inside a loop.

Note:

inside the loop i am changing the values of the parameter array .

it works fine if the loop executes for only one time, but if the loop
executes more than one time i am getting the error : "field xyz is already
contained by another SqlParameterCollection"



Function abc(Parameter_Array)

begin loop

alter Parameter_Array' values

Create command object

Add parameters to the command object //i am getting
error at this point,if this is executed for the second time .

Execute

command.parameters.close();

set connection,command etc.. to null

end
 
Prabeep,

Please don't put Bug in your subject when it is a bug in your program, this
makes the attention from Microsoft guys much lower for this.

Thanks in advance

Cor
 
Cor Ligthert said:
Prabeep,

Please don't put Bug in your subject when it is a bug in your program,
this makes the attention from Microsoft guys much lower for this.

Actually, that's a catch-22. He didn't know it was a bug in his program
until he posted here.

A better, more general rule should be "When asking for help from the
community, don't draw conclusions in your subject line" :)

Robert
 
That is true. But who is more likely to have a bug: Microsoft or him?

It's a bit presumptuous to think that it isn't you who is doing something
right, but that it is Microsoft.
 
Back
Top