473,748 Members | 10,569 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGridView UpDate Datasource

Bob
Hi,
FrameWork 2.0
Quick and dirty job so I thought I would do it all on the UI as quick and
easy as possible.
I got the datagridview to display my Access databaseview by using the
Datasources and dragging the exposed view onto the datagrid as per the help
instructions
I can't get edits to go back to the database.
I have tried editing cells at the UI and also programatically .
With a UI edit the pencil comes up and goes away when I move off the record
but the update does not automatically pass through to the underlying table.

With the prog update the UI does not even show the new values after the code
completes.

The underlying Access query supports updates as when I use it in the access
database I can change values.
I simply want to iterate through the rows of the dgv do some alterations and
save the data.

What am I missing?
Button Click example snippet follows:
Thanks
Bob
foreach (DataGridViewRo w n in this.dgV1.Rows)

{

//Stuff deleted;

n.Cells[3].Value = 999; //example only

}

I then hit the F2 Key but no effect.

I have tried dgv.Refresh

test of underlying bindingsource.A llowedit property shows true

Oct 24 '06 #1
3 16698
Bob
Hi,
The underlying System Generated table adapter is not exposing an update
method.
I then used the same methodology to create a dgv based on the table
underlying the Access query
Its TableAdapter does expose the update method.
The problem is I need the sort to work out the alterations.
Anyway out of this?
Bob

"Bob" <bo*@nowhere.co mwrote in message
news:uM******** ******@TK2MSFTN GP04.phx.gbl...
Hi,
FrameWork 2.0
Quick and dirty job so I thought I would do it all on the UI as quick and
easy as possible.
I got the datagridview to display my Access databaseview by using the
Datasources and dragging the exposed view onto the datagrid as per the
help
instructions
I can't get edits to go back to the database.
I have tried editing cells at the UI and also programatically .
With a UI edit the pencil comes up and goes away when I move off the
record
but the update does not automatically pass through to the underlying
table.
>
With the prog update the UI does not even show the new values after the
code
completes.

The underlying Access query supports updates as when I use it in the
access
database I can change values.
I simply want to iterate through the rows of the dgv do some alterations
and
save the data.

What am I missing?
Button Click example snippet follows:
Thanks
Bob
foreach (DataGridViewRo w n in this.dgV1.Rows)

{

//Stuff deleted;

n.Cells[3].Value = 999; //example only

}

I then hit the F2 Key but no effect.

I have tried dgv.Refresh

test of underlying bindingsource.A llowedit property shows true



Oct 24 '06 #2
Bob, I am having the same problem and I cannot find an answer to it. Any luck?
"Bob" wrote:
Hi,
The underlying System Generated table adapter is not exposing an update
method.
I then used the same methodology to create a dgv based on the table
underlying the Access query
Its TableAdapter does expose the update method.
The problem is I need the sort to work out the alterations.
Anyway out of this?
Bob

"Bob" <bo*@nowhere.co mwrote in message
news:uM******** ******@TK2MSFTN GP04.phx.gbl...
Hi,
FrameWork 2.0
Quick and dirty job so I thought I would do it all on the UI as quick and
easy as possible.
I got the datagridview to display my Access databaseview by using the
Datasources and dragging the exposed view onto the datagrid as per the
help
instructions
I can't get edits to go back to the database.
I have tried editing cells at the UI and also programatically .
With a UI edit the pencil comes up and goes away when I move off the
record
but the update does not automatically pass through to the underlying
table.

With the prog update the UI does not even show the new values after the
code
completes.

The underlying Access query supports updates as when I use it in the
access
database I can change values.
I simply want to iterate through the rows of the dgv do some alterations
and
save the data.

What am I missing?
Button Click example snippet follows:
Thanks
Bob
foreach (DataGridViewRo w n in this.dgV1.Rows)

{

//Stuff deleted;

n.Cells[3].Value = 999; //example only

}

I then hit the F2 Key but no effect.

I have tried dgv.Refresh

test of underlying bindingsource.A llowedit property shows true



Jan 26 '07 #3
If you are using SQL Express, make sure you are updating the right copy of
the database. Check out this link:

http://msdn2.microsoft.com/en-us/lib...89(VS.80).aspx

Robin S.
----------------------------------------------
"Chris" <Ch***@discussi ons.microsoft.c omwrote in message
news:EE******** *************** ***********@mic rosoft.com...
Bob, I am having the same problem and I cannot find an answer to it. Any
luck?
"Bob" wrote:
>Hi,
The underlying System Generated table adapter is not exposing an update
method.
I then used the same methodology to create a dgv based on the table
underlying the Access query
Its TableAdapter does expose the update method.
The problem is I need the sort to work out the alterations.
Anyway out of this?
Bob

"Bob" <bo*@nowhere.co mwrote in message
news:uM******* *******@TK2MSFT NGP04.phx.gbl.. .
Hi,
FrameWork 2.0
Quick and dirty job so I thought I would do it all on the UI as quick
and
easy as possible.
I got the datagridview to display my Access databaseview by using the
Datasources and dragging the exposed view onto the datagrid as per the
help
instructions
I can't get edits to go back to the database.
I have tried editing cells at the UI and also programatically .
With a UI edit the pencil comes up and goes away when I move off the
record
but the update does not automatically pass through to the underlying
table.
>
With the prog update the UI does not even show the new values after
the
code
completes.

The underlying Access query supports updates as when I use it in the
access
database I can change values.
I simply want to iterate through the rows of the dgv do some
alterations
and
save the data.

What am I missing?
Button Click example snippet follows:
Thanks
Bob
foreach (DataGridViewRo w n in this.dgV1.Rows)

{

//Stuff deleted;

n.Cells[3].Value = 999; //example only

}

I then hit the F2 Key but no effect.

I have tried dgv.Refresh

test of underlying bindingsource.A llowedit property shows true





Jan 29 '07 #4

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

Similar topics

2
24556
by: bob | last post by:
Can anyone tell me the best way to update a dataset while it is being edited/viewed in the DataGridView control? Is this something that should be inserted into one of the grid's events? or should you update after closing the grid/form, etc.? Also, can you tell me the best book to buy that fully explains the DataGridView control? Thanks.
11
27318
by: Kevin | last post by:
I've been searching forever for examples of saving data changes in a DataGridView. There's all kinds of examples, but none really show how to save changes. Someone please help me. I have a Windows Forms program with a DataGridView and a BindingSource added to a form. Here is the code I'm using to populate the grid: Dim CRClassesTableAdapter As SqlDataAdapter Dim CRClassesTable As New DataTable()
4
5269
by: Arne Beruldsen | last post by:
I just can't seem to get the datagridview to update. I'm using 2005 vb.net Here's my code for loading the grid (works fine) and my attempt at updating via a save button... Private SxAdapter As New OleDbDataAdapter() Private SxSource As New BindingSource() Private SxTable As New DataTable() Private Sub GetData(ByVal selectCommand As String)
2
15530
by: Steve Richter | last post by:
what is the best way to use DataGridView to view data from large database tables? Where the sql select statement might return millions of rows? string connectionString = GetFinancesConnString(); string sqlSelect = "select CheckNbr, CheckDate, CheckAmt from Disbursements" ; SqlDataAdapter adapter = new SqlDataAdapter(sqlSelect, connectionString);
3
3093
by: =?Utf-8?B?THVib21pcg==?= | last post by:
Hi, I have a DataGridView that displays data from one table from database. I didn’t implement any my code, I just used wizard to do all the work with DatagridView populating. Visual Studio generated strong typed dataset and binding. And here is my problem. I try to update the database with the new (changes) values from DataGridView:
7
15658
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is there an equivalent property for the DataGridView? I have searched, but have not found one. I would like the user to be able to see all the columns of the table on one screen - thus eliminating the need to use the horizontal scroll bar to view...
11
76234
by: dave18 | last post by:
Hello all! I found a solution to my original question, but there's still so much I don't understand about it, I thought I'd give this forum a try. At the very least, maybe it will help someone else who got stumped like I did. It seems so simple... binding a DataGridView to a List<T>. These are the two general problems that I kept running into: (1) When the data in the list updated, the data on the screen did not update. (2) When I...
3
1704
by: Marco Pais | last post by:
Hi there. I have a DataGridView on a desktop application and it's being filled through the use of a Web Service, wich returns a DataSet. The I use datagrid.DataSource=mydataset.tables to bind the data. This dataset contains a table with 4 columns: id, description, status, private. Column status can take 4 values, and private, 2 values. My question is: how can I make the column status a DataGridViewComboBoxColumn and column private a...
1
1608
nev
by: nev | last post by:
Happy Easter to all! I have a problem with a datagridview. I placed code in a button click event as follows: dim dtt as datatable = dataset.employees.copy dtt.DefaultView.RowFilter = "='" & Me.LastNameTextBox.Text & "'" Me.DataGridView.DataSource = "" Me.DataGridView.DataSource = dtt
1
2779
by: Arved Sandstrom | last post by:
This seems to be something so simple that none of the hundred-odd tutorials and forum threads that I have looked at (:-)) apparently thinks it's a problem. In a nutshell, I have two DataGridViews. Each has a BindingSource (and a BindingNavigator). The first view populates successfully based upon a Linq to SQL query in the Form Load (that is, the query is assigned to the DataSource of that view's BindingSource, and the BindingSource is...
0
8991
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
9374
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
9325
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
9249
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...
1
6796
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
4607
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
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
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.