OK, so it sounds like the data is all the same (so you can use the same parameters), except for the dates are different in each insert. So, use the parameters for everything except the dates. Embed the dates as you are currently doing.
~~Bonnie
>>OK, I see. Do you *have* to do it that way? (I'd execute a separate insert for each one). If you *do* have to do it that way, would the various Insert statements be using different parameter names set to different TextBox fields? If so, you could still do it the way I mentioned.
>>
>
>Also, only the dates are different. I'm not sure why do we need to insert the same information multiple times, I'm not yet familiar with the database structure.
>
>>Oh, and one more thing .... since you're building this Insert command string from TextBox values, this means that you're not separating out your UI from your DataAccess. Are you aware that this is bad practice? If you DataBind your TextBox controls to either a DataSet or some other business object, you could pass the DataSet (or biz object) back to your DataAccess classes and not have all that code in your UI (where it *should not* be!!)
>>
>>~~Bonnie
>>
>
>Hi Bonnie,
>
>This is not my code. It is complex web-site (for me, at least, at the moment). For now I need to fix a simple problem, that the recurring event is not saved correctly in the database. I'm just working with the existing code slowly trying to understand it. The code simply tries to create a long insert command to create records with future dates. It doesn't take into account Holidays, as I see.
>
>Also perhaps it should be a SP instead, I think. The User interface and code seem to intermix in this particular page.