Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 16th, 2005, 04:48 AM
Registered User
 
Join Date: Sep 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Batch Updates using Access/OleDb

Hi guys,

I am building a custom news editing application. I have a datagrid with news stories in and do not want to make this datagrid editable.

However, there are two columns of information which it would be useful to update directly in the grid for multiple records.

These are whether to set the news story to "active" by ticking a checkbox, and where the story appears (e.g. top, middle, bottom) on the page, which I want to change using a Drop-Down List Box.

So, each row/record in the datagrid will have a checkbox and list box.

At the moment, when the user clicks the "Update" button, the application checks each row and whether the checkbox or dropdownlist has changed from its original (database) state. If it has, then it updates the database with the new selection.

My question is - what is the best way to update the database?

At the moment, the program cycles through a FOR loop and compares the selected value of the control against the value in the database. If they are different, it puts through an OleDbCommand to update it.

This doesn't seem very efficient, as if you had 20 rows to update, it would require 20 separate updates.

Is there a way of doing a batch update for multiple records in the same table, perhaps using SQL Set notation or similar?

Thanks in advance,

Graham Wilson.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Access database through oledb commands castor C# 1 April 26th, 2007 12:27 PM
VB. NET MS Access 2003 OLEDB connection mike.cody ASP.NET 1.0 and 1.1 Basics 1 February 22nd, 2006 08:20 PM
OLEDB with ASP.NET and MS Access DB krishanu Classic ASP Databases 0 June 8th, 2005 12:52 PM
Need HELP, MS access DB, Jet OLEDB, asp Caley L. Baumgart Classic ASP Databases 7 March 23rd, 2004 11:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.