Question: I was wondering why the result of the following code is 0 and not 3.

```
var fn = function(){
    for (i = 0; i < 3; i++){
        return function(){
            console.log(i);
        };
    }
}();

fn();

```

Answer: 
If you put `command = connection.CreateCommand();` inside your for loop, it will work. The problem is you are looping over the command parameters only, so its trying to add more parameters to your existing command, but theyre already in there. So you need to make a new command every loop instead.
You need to add Command parameters outside the loop or declare Command inside the loop. 

In the first case you will need to update each parameter's value like this:

```
oleDbCommand1.Parameters["@UserID"].Value = Details.ID;

```

And execute the command once new values are set.