473,750 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Updating Data in a DataView

Tim
Hi Guys,

I have a situation where I have a grid loaded with data. It is not data
bound. Clicking an image opens up another form that allows the change of
the data in the grid.

Right now the changed data (1 row) is written to the DB and the whole
grid is reloaded from the DB which now incorporates the change.

My question is can I update the data in a data view? That way I can
right the change to the DB and update the DataView without having to dip
the DB every time and essentially avoid reloading a 1000 rows of data
because I changed one.

How do I change one row in a DataView?

Thanks

Tim
Nov 17 '05 #1
1 4019
You can use the GetChanges method to create a new DataSet that can be sent
into a DataAdapter to perform your update on only the changed rows. Since
you've already made the change to the original dataset, you don't need to
return everything back from the database. This of course doesn't take into
account concurrency issues, but it may be sufficient for your issue.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Tim" wrote:
Hi Guys,

I have a situation where I have a grid loaded with data. It is not data
bound. Clicking an image opens up another form that allows the change of
the data in the grid.

Right now the changed data (1 row) is written to the DB and the whole
grid is reloaded from the DB which now incorporates the change.

My question is can I update the data in a data view? That way I can
right the change to the DB and update the DataView without having to dip
the DB every time and essentially avoid reloading a 1000 rows of data
because I changed one.

How do I change one row in a DataView?

Thanks

Tim

Nov 17 '05 #2

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

Similar topics

1
3488
by: Ben | last post by:
Dim dv As DataView = New DataView (DataSet11.Tables("InventoryTable")) dv.RowFilter = "ItemAuthor LIKE '" & ItemAuthor.Text & "%'" dv.RowStateFilter = DataViewRowState.ModifiedCurrent dv.Sort = "ItemID" Dim temp As Integer = dv.Count()
9
4210
by: Bill Salling | last post by:
am trying to updated the source data(Access2000) for my data grid. But keep getting this error An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dl Additional information: Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information I can get the error message to disapper by using the AcceptChanges action to the dataset, but...
2
5608
by: Nanda | last post by:
hi, i have an editable datagrid. how can i update the database, When the user completes entering data for a row. i.e., data should be updated whenever user completes entering a row. Thanks in advance.
3
1699
by: Terry McNamee | last post by:
I have a DataTable which i have added data to. I have a custom method that prints a DataView of the DataTable out on the screen. The problem I'm having is, i need to call the custom method whenever the DataTable is changed. How can I do this? this is not a standard binding problem, since I need to call a custom method to paint the items on the screen. view.ListChanged += new ListChangedEventHandler(this.view_Changed);
3
1601
by: Colin Young | last post by:
I'm having a bit of a problem with my DataList when I try to update from the user's input. I've included relevant excerpts at the end of this message. In the UpdateCommand code, the "PageLevelTextBox" appears to be found (it isn't returning null), but the Text property is an empty string (""). Am I missing something really obvious? Thanks Colin
2
973
by: amber | last post by:
Hello I can't get my update command to work.. I've used the sqlDataAdapter wizard to create a dataAdapter sqlDA_CB_LP, and it created the 'UPDATE' code as follows Me.sqlDA_CB_LP.UpdateCommand = Me.SqlUpdateCommand Me.SqlUpdateCommand4.Connection = Me.SqlConnection Me.SqlUpdateCommand4.Parameters.Add(New System.Data.SqlClient.SqlParameter("@STR_COMMENT", System.Data.SqlDbType.NVarChar, 1073741823, "STR_COMMENT")
7
1044
by: Gary Paris | last post by:
I am pretty new at .NET and am reading a book on ADO.NET but I need some help. I have the following code in the Load routine of a sample program. I would like to read in some data and take the first row and put a few fields on a form. Then I would like to update the data. How on earth can I update the rows when I call an update routine? The table and datarow are defined in the Load routine and are not global. If I have another...
1
1965
by: batista | last post by:
Hello all, I have a third praty grid control...named C1grid. Im using it in one of my apps.. Now, I have bind this grid to a custom dataset class named "DataViewEx". The code of the class is below... Now what happens is that im updating this dataviewex class from a separate thread.....
0
1470
by: Chet | last post by:
I have a Datagrid that is bound to a Datatable at runtime. I allow the user to select a number of rows using the mouse and then click a button that says "check selected rows", which then cycles through the selected rows and sets a check box field in the datagrid (and thus the databound datatable) to checked/true. It works like this: Dim cel As DataGridViewCheckBoxCell For Each row In DataGrid.SelectedRows cel = row.Cells(0) cel.Value =...
0
8838
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
8260
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...
1
6804
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 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...
0
6081
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();...
0
4713
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4887
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3322
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
2804
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2225
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.