>What error are you getting? Is it at run-time or compile-time?
>
>~~Bonnie
>
In run-time that variable @EventVal already declared (something like that, I'm trying to work on another problem right now).
>>Can I use the same technique within a loop or I should go John's way?
>>
>>I tried to change the original code using string.Format to
>>
>> foreach (ListItem Item in this.lsbEvntTargetPop.Items)
>> {
>> if (Item.Selected)
>> {
>> Command.CommandText += "\nINSERT INTO EventTargets VALUES(@EvID,@EventVal)";
>> Command.Parameters.AddWithValue("@EventVal", Item.Value);
>>
>> }
>> }
>>
>>but I'm getting an error. How should I change this?
>>
>>Thanks again for your help.
If it's not broken, fix it until it is.
My Blog