473,506 Members | 14,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

updating dataset from datagrid

Jim
I have a dataset-bound datagrid and, when the user adds a row to the
datagrid and fills it with the data, I'd like to be able to update the
dataset (with the newly-added row) and then the database table (also with
the newly-added row).

Normally I'd do it with a DataAdapter method call but the dataset is
returned from within another class (I don't declare the dataadapter here).
What can I do?

Thanks.

Thanks.
Nov 15 '05 #1
1 1448
Jim:
Think about this analogy....I can't spend more than $500.00 a month on all
of my living expenses. However, I want to buy a 2003 Porsche. Those two
requirement don't play well together. Fortunately, you can look at the
DataSet GetChanges and then manually write a ton of code to
update/insert/Delete. Or, you can declare your DataAdapter locally, and set
a property in your class that maps to the original dataAdapter.
Fortunately, you can have it both ways.

I'm going to ruffle a few feathers here, but if you are using disconnected
methodology....don't let the adapter leave scope and lose its references if
you need to update with it.

If this is too vague, let me know and I'll walk you through it.

Cheers,

Bill
"Jim" <NA> wrote in message news:OH**************@TK2MSFTNGP09.phx.gbl...
I have a dataset-bound datagrid and, when the user adds a row to the
datagrid and fills it with the data, I'd like to be able to update the
dataset (with the newly-added row) and then the database table (also with
the newly-added row).

Normally I'd do it with a DataAdapter method call but the dataset is
returned from within another class (I don't declare the dataadapter here).
What can I do?

Thanks.

Thanks.

Nov 15 '05 #2

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

Similar topics

0
1290
by: cwbp17 | last post by:
Have two tables that have a FK relationship on ID column. Have one datagrid that displays all of the columns of both tables. What's the best approach on updating a row from the datagrid back to...
1
5277
by: sandman | last post by:
I've got a simple windows form with some bound textboxes and Save button. Each texbox is bound to column in a table in an Access database. The form fills fine - all the fields show the correct...
9
1637
by: Pam Ammond | last post by:
After clicking btnDeleteSize_Click in frmSize, I move to frmSizeDelete, allow deleting a Size using a datagrid, and then return to frmSize and want to update the datagrid in frmSize to reflect the...
5
2013
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
1
1320
by: Geraldine Hobley | last post by:
hello, I have put thisup b4, but I think that people have misunderstood the problem, so I will make it clearer. I have a problem updating a dataset that is bound to a datagrid. The code that I...
10
5625
by: jaYPee | last post by:
does anyone experienced slowness when updating a dataset using AcceptChanges? when calling this code it takes many seconds to update the database SqlDataAdapter1.Update(DsStudentCourse1)...
14
2104
by: Lars Netzel | last post by:
A little background: I use three Datagrids that are in a child parent relation. I Use Negative Autoincrement on the the DataTables and that's workning nice. My problem is when I Update these...
2
13937
by: susan.f.barrett | last post by:
Hi, Despite me being able to type the following in to SQL Server and it updating 1 row: > updatestockcategory 1093, 839 In my code, it is not updating any rows. dataSet = new DataSet();
2
1314
by: marcmc | last post by:
Hey, I have never used a datagrid/dataset/adaptor/table method for updating data, I have always used direct updates to the database so ADO is quite new to me. I have a datagrid and I change a...
2
4357
by: toddw607 | last post by:
Hi Everyone! I have a ASP.NET webform that brings data in from SQL Server 2000 and displays it on a page. I want to update the webpage while in IE using the following code: <%@ Import...
0
7220
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
7371
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...
1
7023
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...
0
7479
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...
0
5617
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,...
1
5037
isladogs
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...
0
4702
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...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.