473,386 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Combining multiple SQL Update commands for Access database?

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
0 1199

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: jimserac | last post by:
I had previously posted this in an Access forum with negative results so will try here. Although this question specifies an Access database, I also wish to accomplish this with a large MS SQL...
3
by: Tc | last post by:
Hi, I was curious, I am thinking of writing an application that loads a dataset from a database that resides on a server. The question I have is this, if multiple copies of the app will be...
9
by: jaYPee | last post by:
I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables. my 3 tables looks like the 3 tables from...
0
by: jack daniels via .NET 247 | last post by:
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...
1
by: Togacaptain | last post by:
I have a large database driven app that allows multiple web services to be deployed each allowing access to different parts of the database. I want to build a C# service to consume all of the web...
1
by: Anil Gupte | last post by:
This .Net Database stuff is way too complicated. Just to make a Select statement on an Access database, I have to first get a connection string, then open a connection to the database, then create...
3
by: TClancey | last post by:
Hi all. I have an app that needs to connect to either - an Access database, MySql database or MsSql database. It will be the end users decision which they want to use. I've done a lot of...
13
by: =?Utf-8?B?VmVybm9uIFBlcHBlcnM=?= | last post by:
I am using VS2005. I created a Windows Appication project. Inside the Server Explorer, I created a new SQLExpress database, and then created a new table. I added the rows, making my first row an...
13
by: Terry Olsen | last post by:
I'm using OleDb to connect with an Access Database. I have anywhere from 10 to over 100 records that I need to either INSERT if the PK doesn't exist or UPDATE if the PK does exist, all in a single...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.