Thanks for looking at my blog, Bill!
Yes, Naomi is correct about the parameters. If this is a SQL Server database, then you'd want to be using the SqlDataAdapter and named parameters and it'll all work fine.
If it's not a SQL Server database and you have to use the OleDbDataAdapter and positional parameters, this won't work since the parameters are positional. But, in that situation you can use the OleDbCommandBuilder.DeriveParameters() method (that method exists for SqlCommandBuilder also). There are two downsides to this method:
1) there's an extra round-trip to the database so it can figure out the parameters for you and
2) you still need to supply the value, but that may be able to be done in a loop through the DataTable's columns, similar to the SetAllParameters() method in my blog post.
~~Bonnie
>In an app I'm developing, I'm using stored procedures to update and create new records for a table.
>There are lots and lots of columns in this table and it will grow as the app matures.
>I'm creating the command to call to the stored procedure and adding the parameters, one by one.
>That's a LOT of typing.
>
>Looking at Bonnie's blog, I found some code that will generate the parameters and values for me.
>Will that work if the generated parameters are not in the same sequence as they are declared in the stored procedure?
>
>Any other ideas to cut down on the typing?