473,805 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Updating DataTable bound to a DataGridView

Hi,

I've a DataGridView with Datasourse = Datatable.
The problem is that I can't get my last record updated at the database
unless I change the row where I'm editing...
Can anyone explain me why and how can I manage to get rid of this?

By the way, Im' updating with DataAdapter.Upd ate(DataTable)

Thanks in advance
CC
Jul 26 '06 #1
3 5138
Carlos,

Was that in past (version 1.x) the currentmanager. endcurrentedit is it now
the Bindingsource.e ndedit which is doing the trick to force the rows into
the datasource.

http://msdn2.microsoft.com/en-us/lib...e.endedit.aspx

I hope this helps,

Cor

"Carlos Cruz" <ca************ *@gmail.comschr eef in bericht
news:u5******** ******@TK2MSFTN GP06.phx.gbl...
Hi,

I've a DataGridView with Datasourse = Datatable.
The problem is that I can't get my last record updated at the database
unless I change the row where I'm editing...
Can anyone explain me why and how can I manage to get rid of this?

By the way, Im' updating with DataAdapter.Upd ate(DataTable)

Thanks in advance
CC

Jul 27 '06 #2
Cor, I'm having a similar problem. Tried dropping a bindingsource on my
form & used it as the datasource for my datagridview. Assigned my dataset as
datasource for the bindingsource. However, this seems to have no effect --
no rows are displayed (if I use the dataset as the datasource for the grid,
I do have rows). What is the magic step I'm leaving out?

Jeremy
Was that in past (version 1.x) the currentmanager. endcurrentedit is it now
the Bindingsource.e ndedit which is doing the trick to force the rows into
the datasource.

http://msdn2.microsoft.com/en-us/lib...e.endedit.aspx
Jul 27 '06 #3
Jeremy,

Did you do it like this?

http://www.vb-tips.com/dbpages.aspx?...2-b1ed16424252

Cor

"JeremyGran d" <je****@ninprod ata.comschreef in bericht
news:%2******** *******@TK2MSFT NGP05.phx.gbl.. .
Cor, I'm having a similar problem. Tried dropping a bindingsource on my
form & used it as the datasource for my datagridview. Assigned my dataset
as datasource for the bindingsource. However, this seems to have no
effect -- no rows are displayed (if I use the dataset as the datasource
for the grid, I do have rows). What is the magic step I'm leaving out?

Jeremy
>Was that in past (version 1.x) the currentmanager. endcurrentedit is it
now the Bindingsource.e ndedit which is doing the trick to force the rows
into the datasource.

http://msdn2.microsoft.com/en-us/lib...e.endedit.aspx

Jul 28 '06 #4

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

Similar topics

0
1341
by: Bob | last post by:
I have relational integrity set up in my sql server 2005 database that prevents cascading deletes in some cases. I'm using a bound datagrid view and a tablenavigator. When I click the delete button on it then the save button, I get the message saying a foreign key constraint does not allow the deletion, but the row is no longer shown in the datagridview. Only way I get to see it is to close my form and open it again, then row is there OK....
0
987
by: Irfan | last post by:
hi, I have a 'TimeSheet' Table in the database that holds data about the time spent by an employee on each project on a particular day. TS_pk Emp_fk Project_fk hrsWorked Date 1 1 10 4 13/02/2006 2 1 20 5 14/02/2006
1
19794
by: Lars E | last post by:
Hi all I have a small problem. I have a datatable with 8 columns. But it is only data in 5 of the columns. Data for the remaing 3 columns is in another dataset. I Want to run trough the datatable and fill out the remaining data. My code so far: if (this.fetch("custinfo", "fetchCustInfo", out customers, parameters))
0
1263
by: D2 | last post by:
Hi All, I have a bound DataGridView control where I wish to add a new row. The simple solution turns out to be add a new row to the underlying datatable object and the changes will automatically reflect in the grid. However, I seem to have caught something bad. My query is something like this: select * from where orderid=x
1
2516
by: weird0 | last post by:
How can i update the data in my database directly through datagridview....? Can anyone tell me the appropriate links and what is the exact event in datagridview that handles it and some explanation abut how to handle it. what does ds.Tables...ds.Tables return by the way? What does it mean? DatagridView.DataSource=ds.Tables; // one of the statement in my code Why?
1
1770
nev
by: nev | last post by:
i have a bound datagridview which has no data yet. it has a bindingnavigator along with it. enable adding, editing & deleting of rows is checked. now here's the scenario... when i run the program, since there is no record yet, a single row is displayed as a new row. when i click the row to enter data, the bindingnavigator count becomes 1 from 0. the delete bindingnavigator button becomes enabled. now what i will do is click the delete button...
0
1473
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 =...
1
1744
by: JustinD30324 | last post by:
Hello. I have a DataGridView that is bound to a DataTable. If the user types in values for all the columns for the first row, then clicks into a column in the second row (empty), and then clicks back into the first row he just typed, then an empty row is added to the DataGridView. I'm guessing that somehow the AddRow function is being called when the user clicks in and out of the empty row. I don't want this to happen. A new row should...
0
2973
by: Proogeren | last post by:
I have made a service that sends a datatable with person information to a client. In the forms init event I call the service to retreive all persons from my service and displays them in a datagridview. In the form I want to be able to filter on e.g. first name. I have used the select method to filter on the datatable but it only returns datarows and not datatable which I need to set as datasource in my datagridview. Also I can not add the...
0
9718
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
10617
Oralloy
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...
1
10370
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,...
1
7649
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
5545
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
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4328
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
3849
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
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.