473,714 Members | 2,625 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Updating Disconnected DataSets with GridView

I am trying to create a Session-Wide, Disconnected, Updatable
DataTable (or DataSet) object and use it through an ASP.NET GridView.

The scenario is this:

1. When the page is first loaded, connect to DB, get data, fill
2. Bind DataTable to GridView. Set DataTable as a Session object.
3. User continues navigating page, but after first load, no more DB
connection is made, grid is filled from DataTable Session object.
4. Sometime, user sets GridView to edit mode and makes some changes.
Then he clicks Update button on GridView.

This is where I fail. I somehow imagine that there must be a way to
reflect user's change on Gridview to DataTable Session object (NOT to
actual DB)

So when user continues navigating page, he will see updated data
(since DataTable is Session-wide) however the actual DB is not

I've tried triggering GridView1.Updat eRow(e.RowIndex , false) on
GridView1_RowUp dating event but it gives me stack overflow (huh?)


Mar 22 '07 #1
1 3622
I've tried triggering GridView1.Updat eRow(e.RowIndex , false) on
GridView1_RowUp dating event but it gives me stack overflow (huh?)
It is supposed to overflow because of recursive callback (UpdateRow
itself raises RowUpdating event, from where it is getting called

In any case GridView's automatic row update is intended for
DataSourceContr ol (i.e. the one set by by DataSourceID instead of
DataSource). Your best bet is probably to manually update the table
stored in Session state in RowUpdating or RowCommand event.

Mar 23 '07 #2

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

Similar topics

by: Andrew | last post by:
I'm a long time VB6/ADO and Java developer new to ADO.NET. I'm trying to decide on best practices and I'd appreciate any assistance. I have one specific question and another more general architectural one: 1. How can you pass around a disconnected DataSet/DataTable, make changes to it and then pass it into a component for update? The disconnected DataSet doesn't know it's UPDATE statement and the DataAdapter is long since gone. 2....
by: enrique | last post by:
Hi, I apologize for a newbie question, but my books/research have yielded me no examples and my time is now short. I simply want to update data from text boxes (fields). I'm not using a datagrid or datalist I found plenty of examples of how to do that and can get that to work. I simply want to update my databound text boxes. I'm using visual studios DataAdapters, DataSets and Dataviews. I can insert to the database utilizing the...
by: | last post by:
Hello, I have created an ASP.NET 2.0 application that utilized a Gridview Control to display and update/delete data. The problem I am having is that the gridview control is displaying the data correctly but it is not updating or deleting the rows. What I did was, in design view, added a gridview control and added an sqldatasource control. I configured the data source to update and delete. In the gridview tasks I selected enable...
by: Rich | last post by:
Hello, I have to read and write around one million records from an external data source to Sql Server2k every night. That's a lot of I/O. I am using VB6 for this (takes hours). I am connecting to the external data source with API's from its object library (as opposed to ODBC in which case I would just use DTS to pull this data) and just looping. I was thinking that with VB.Net I could read this data into a dataset in memory...
by: Commander Ace | last post by:
Hi, I'm having some problems with updating an SQL Database with modified fields from a datatable. I got the code from a Wrox book, 'Professional VB.NET 2003', the same code can be found here: http://media.wiley.com/product_ancillary/23/07645599/DOWNLOAD/559923_CODE_8_10_16_22_23_24_25.zip \Chapter 16\AuthorEditor Basically when I have made a change and save it, close and reopen the program the changes that I made have gone, and it’s the...
by: garethdjames | last post by:
For scalability we wish to use disconnected DataSets and hold them in the application cache. This means that multiple concurrent users will be reading the data (its read only) The DataSet is fairly complicated and contains many tables and many relationships What we would like to do is create a DataView that flattens the in
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got answered... There are articles on the new TableAdapters where it says that a key new advantage is that a single TableAdapter, which can have multiple queries, can be used on multiple forms. Now that was in an article on using TableAdapters with...
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following problem that has occurred to me. Suppose I have two tables in an SQL Server database. Let's call these tables A and B. Assume that A has two fields: a primary key and another holding a string. In table B there are three fields: a primary key, a foreign key (which links to the primary key in A) and other field holding a string.
by: BillE | last post by:
I'm trying to decide if it is better to use typed datasets or business objects, so I would appreciate any thoughts from someone with more experience. When I use a business object to populate a gridview, for example, I loop through a datareader, populating an array list with instances of a custom class in the middle tier, and then send the array list up to the presentation layer and bind the gridview to it. If I use a typed dataset, I...
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...
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,...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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...
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...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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

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.