By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,544 Members | 2,065 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,544 IT Pros & Developers. It's quick & easy.

Combining multiple SQL Update commands for Access database?

P: n/a
Hi! Perhaps you know of a better way here.

I have an Access database, actually a single table. Now, at the click of a button on a C# Form, each and every single cell associated with the primary keys has to be updated. I have the new cell values in an arraylist and this is what I am doing:

for (int i = 0; i < numberOfPrimaryKeys; i++)
{
adapter.UpdateCommand = new OleDbCommand(strSQL, conn);
adapter.UpdateCommand.ExecuteNonQuery();
}

"strSQL" has the update command for a row; I am updating the Access database one row-command at a time.

My God, ONE ROW-COMMAND AT A TIME! Is there a better way, a faster way?

I read somewhere that I can combine multiple SQL statements by separating them with a semi-colon and putting the whole lot into the "strSQL" string. Apparently, that doesn't work, at least not with an Access database.

Any and every comment will help. Thanks!

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>0gV1P4Nq+kKMU6MPygvong==</Id>
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.