DataGridView UpDate Datasource

B

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 (DataGridViewRow 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.Allowedit property shows true
 
B

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
 
G

Guest

Bob, I am having the same problem and I cannot find an answer to it. Any luck?


Bob said:
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 said:
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 (DataGridViewRow 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.Allowedit property shows true
 
R

RobinS

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/library/ms246989(VS.80).aspx

Robin S.
----------------------------------------------
Chris said:
Bob, I am having the same problem and I cannot find an answer to it. Any
luck?


Bob said:
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 said:
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 (DataGridViewRow 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.Allowedit property shows true
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top