Results 1 to 2 of 2

Thread: [2.0] for loop and SQLExecute

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    [2.0] for loop and SQLExecute

    I am trying to randomly generate 30 pieces of data. All works well, except for one thing

    I have a for loop, which runs 30 times.

    foreach loop, it creates the SQL parameters, adds them to SQLCommand and executenonquery().

    it only goes round the loop 3 times, or it seems to only insert 3 records and thats it.


    however if i step in the debugger, it seems to generate/insert data 30 times - as wanted.

    if i insert a Thread.Sleep (50) it inserts 30 records fine, but i should not have to do this surely?

    any ideas? Why does it do it properly when I am debugging (putting a breakpoint) but not when I am making it run on its own?
    Last edited by Techno; Apr 8th, 2006 at 04:21 PM.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width