473,791 Members | 2,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Batch Updates from a Grid

Hello,

Doing my first ASP project so this may be simple and I'm missing
something...cou ld someone please calrify this for me?

1. I have an ASP page with a grich which allows user to add, edit and
delete records.

2. The grid is linked to an objectdatasourc e which points to a
business class

3. The business class has the usual add/edit/ delete methods which in
turn pass these requests through to a tableadapter which I generated
using the data set designer.

4. The table adapter is using stored procedures to do the insert /
edit / delete

5. In this scenario the grid is adding records / deleting etc.
directly to the database. I want this to behave more like a windows
style grid where the updates are not sent to the actual database until
the I execute the update method.

Is there a standard way of doing this? My initial thoughts were to
have the business class's update / insert / delete methods work on a
datatable which I create from the initial select, then have an update
method that jsut calls teh table adapters update method, but how this
works is making my head spin a little. Presumably I'll have to have
the datatable sent to and from the client as part of the session - is
this correct?

I'm guessing in general this is not a good idea but in this case there
will be at msoat 20 records or so.

If I'm correct and this is the best way to go, I guess my business
class will have to retrieve the dataTable from the session for each
delete / update / insert operation?

Cheers in advance,

Ray

Jun 27 '08 #1
2 1268
Essentially, you can pass a DataTable that has any combination of new,
deleted and / or modified rows into a DataAdapter's Update method and as long
as you have the correct insert, delete and update commands, it will process
all the rows at once.

So really all you need to do is engineer the way to do this that is most
comfortable for your situation.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
"rbrowning1 958" wrote:
Hello,

Doing my first ASP project so this may be simple and I'm missing
something...cou ld someone please calrify this for me?

1. I have an ASP page with a grich which allows user to add, edit and
delete records.

2. The grid is linked to an objectdatasourc e which points to a
business class

3. The business class has the usual add/edit/ delete methods which in
turn pass these requests through to a tableadapter which I generated
using the data set designer.

4. The table adapter is using stored procedures to do the insert /
edit / delete

5. In this scenario the grid is adding records / deleting etc.
directly to the database. I want this to behave more like a windows
style grid where the updates are not sent to the actual database until
the I execute the update method.

Is there a standard way of doing this? My initial thoughts were to
have the business class's update / insert / delete methods work on a
datatable which I create from the initial select, then have an update
method that jsut calls teh table adapters update method, but how this
works is making my head spin a little. Presumably I'll have to have
the datatable sent to and from the client as part of the session - is
this correct?

I'm guessing in general this is not a good idea but in this case there
will be at msoat 20 records or so.

If I'm correct and this is the best way to go, I guess my business
class will have to retrieve the dataTable from the session for each
delete / update / insert operation?

Cheers in advance,

Ray

Jun 27 '08 #2
Hi Peter,

Thanks for replying. I know about the update method and how it can
batch things for you but I suppose I'm a little unclear as to how this
works in a web environment. If my business object adds things to a
datatable or a dataset then updates when requested, rather than
directly to the databse, where does the datatable / dataset get
stored? Doesn't it need to be part of the session?

Cheers

Ray

On Apr 12, 7:01*pm, Peter Bromberg [C# MVP]
<pbromb...@yaho o.NoSpamMaam.co mwrote:
Essentially, you can pass a DataTable that has any combination of new,
deleted and / or modified rows into a DataAdapter's Update method and as long
as you have the correct insert, delete and update commands, it will process
all the rows at once.

So really all you need to do is engineer the way to do this that is most
comfortable for your situation.
-- Peter
Site:http://www.eggheadcafe.com
UnBlog:http://petesbloggerama.blogspot.com
Short Urls & more:http://ittyurl.net

"rbrowning1 958" wrote:
Hello,
Doing my first ASP project so this may be simple and I'm missing
something...cou ld someone please calrify this for me?
1. I have an ASP page with a grich which allows user to add, edit and
delete records.
2. The grid is linked to an objectdatasourc e which points to a
business class
3. The business class has the usual add/edit/ delete methods which in
turn pass these requests through to a tableadapter which I generated
using the data set designer.
4. The table adapter is using stored procedures to do the insert /
edit / delete
5. In this scenario the grid is adding records / deleting etc.
directly to the database. I want this to behave more like a windows
style grid where the updates are not sent to the actual database until
the I execute the update method.
Is there a standard way of doing this? My initial thoughts were to
have the business class's update / insert / delete methods work on a
datatable which I create from the initial select, then have an update
method that jsut calls teh table adapters update method, but how this
works is making my head spin a little. Presumably I'll have to have
the datatable sent to and from the client as part of the session - is
this correct?
I'm guessing in general this is not a good idea but in this case there
will be at msoat 20 records or so.
If I'm correct and this is the best way to go, I guess my business
class will have to retrieve the dataTable from the session for each
delete / update / insert operation?
Cheers in advance,
Ray- Hide quoted text -

- Show quoted text -
Jun 27 '08 #3

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

Similar topics

0
986
by: Gino | last post by:
HI, I am fairly new to python. I have created a simple wxpython application that has a grid on a form. The grid is populated dynamically by making a call to the database. I have an event that when a row is double-clicked on, another form is launched and the user can eidt the values in the database and writed the changes to the database. This works fine, the problem is that once the changes are made, these changes are not reflected...
5
2052
by: Tyler Hudson | last post by:
After reading Erland Sommarskog's most enlightening articles on SQL Server 2000's error handling capabilities (http://www.sommarskog.se/error-handling-I.html and http://www.sommarskog.se/error-handling-II.html) I have a question regarding batch cancellation caused by a client. Because a batch cancel request from a client does not cause a rollback, is there any danger of the commands that were executed in the batch before the client...
2
3593
by: Mats Mohlin | last post by:
We are runing a critical batchjob in DB2 V8 fp4 for AIX on a p630 with AIX 5.2 The job updates only 6 columns of the 100 columns in a 600 bytes wide row. The job is very IO bound because of log writes. We seems to be logging full rows 600 bytes per updated row. I thought DB2 should be clever enough to only log the modified columns ?? We also seems to write to the log with a lot of small writes, filemon -v -O lf output indicates
3
5065
by: Keith Wilby | last post by:
I have some code in my app that updates data by interrogating data from Artemis. It works fine, but I wondered if I'd be able to write a batch file which, at a predetermined time each day, would open the app 'silently' and run the code. I'm no whizz at batch files/DOS commands, but I've written them to open an Access app - it's the rest of it that I need advice about. How would I get the app to recognise that it was opened by the batch...
3
2297
by: brian | last post by:
I have a problem that probably has a simple solution but I don't have much SQL experience... My company's database is pretty crummy, based on Access97 .MDB files with a VB front-end. My company sends updates to our clients every month via e-mail, over the past 7 years a lot of the addresses have gone out of use and we get more and more bounce-backs. We are looking to update our contact database but our old database does not allow us...
1
1389
by: Rolan | last post by:
I would guess that someone has done this before, but I cannot seem to get it to work. In a given month, there are hundreds of updates received that need to be entered. It is obviously a slow and tedious task to import them one at a time. What I would like to do is to place all of the updates into one directory and import them all at one time. However, DoCmd.TransferText acImportDelim, , "Updates" , "C:\Item Updates\*.txt" , True does not...
4
1207
by: VM | last post by:
Is it possible that a thread that updates a grid give me problems? For some reason, when the for loop is really big (30000+ rows in grid), I get "Object reference not set to an instance of an object" or "External component has thrown an exception" in some rows. And it always happens in the first few records (rec. 30-40 when I'm stepping through the code or rec. 10-18 when I'm not). This is the code: private void runProcess()
16
2748
by: Richard Maher | last post by:
Hi, I have this Applet-hosted Socket connection to my server and in an ONevent/function I am retrieving all these lovely rows from the server and inserting them into the Select-List. (The on screen appearance of the Select List grows for the first 5 rows then the scroll bar appears if there's more). So far so good. . . The problem is that none of the rows I'm inserting appear on the screen until I have RETURNed from my function; so If...
8
6258
by: Nick | last post by:
Hi there, I have a GridView in an UpdatePanel, each time the UpdatePanels Load event fires I set the DataSource and call DataBind of the grid view. This works great once, I add an item to the list and the control updates, my breakpoints get in in the UpdatePanel Load event. Only problem is on the second time, even though the code is executed, the GridView doesn't change. I have disabled the view state for the grid view but still the...
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10154
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.