You're right, Thanks Joyjit for helping me.
Bye, Pierluigi.
"Joyjit Mukherjee" <(E-Mail Removed)> ha scritto nel messaggio
news:%(E-Mail Removed)...
> Hi,
>
> as your parameter collection changes for each execution, you need to
change
> the values only viz.,
>
> SqlParameter myParameter = new SqlParameter("@MyVar", SqlDbType.VarChar);
> myParameter["@MyVar"].Value = "My Value";
>
> // later on
>
> myParameter["@MyVar"].Value = "My 2nd Value";
>
> etc.
>
> Regards
>
> Joyjit
>
> "Pierluigi Terzoli" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi everybody,
> > I have a simple question:
> > I need to execute the same SQL statement (an Insert one) several times.
> > This command has some parameters, I'll make an example:
> > INSERT INTO test (id) VALUES (@id) --> (for SQLServer engine)
> > So, I'd like to have a SqlParameter collection and every time change the
> > value of the parameter only.
> > I didn't find any method to do it.
> > Do I have to SqlParameter.Clear() the collection and rebuild it every
time
> > ??
> > Thanks in advance, Pierluigi.
> >
> >
>
>
|