Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dataGridView - commiting data

Status
Not open for further replies.

martinm

IS-IT--Management
Mar 30, 2001
113
GB
Hi all, new here, Delphi developer for about 9 yrs, now having a tinker with C# using Visual Studio 2005. I'm having a problem with a dataGridView - I've got it connected to my SQLExpress DB - it's displaying existing data. However, I can't get new/edited records data to commit. Also, I've got a navigator that I think is connected, but it is disabled. Any idea gratefully received! Cheers.
 
Would it be possible to show us how you are currently doing it as there are many ways?

Age is a consequence of experience
 
Perhaps I should explain a little bit. Is the DataGridView connected to the database via a Dataset/ DataTable if it is, does the datatable have the changes in?

Age is a consequence of experience
 
Not sure off the top of my head!! I'm not home tonight, but will check and post on Friday pm.

Cheers.
 
OK, had a look :
Setup as follows -

DataGridView1.DataSource = addressBindingSource1
AddressBindingSource1.DataSource = propertyDataSet

All the relevant DataGridView1 ReadOnly props are False

The grid enters Edit mode ok (row Icon changes to pencil)

I've got the Navigator workong (didn't have it bound)

Still can't post/commit new rows though.


'does the datatable have the changes in?' How do I check?

Ta.
 
You check this by setting a breakpoint at the point you expect the data to be entered. Then add the datatable to your watch, go along the watch view until you see the magnifying glass. Click this… wait a moment. You should now see your data in the view?

Age is a consequence of experience
 
Ah - is there not an autocommit type property?

If not, how do I explicitly commit the new record?

 
was the data there?

Age is a consequence of experience
 
Not sure - I'm expecting the data to be committed when I exit the row/grid, so don't have anywhere to put a breakpoint. If there's an 'onpost' type event I can look there, but very unfamiliar with the events available at the mo!!
 
Sorry.. I think some else may have to help you with this as I am unfamiliar with the way you are doing it?

Age is a consequence of experience
 
No worries - how would you do it may be a better question to ask!!
 
What I will do is point you to a MS tutorial and if you have any problems with it, I will help you with them. It is in ASP.NET but it is exactly the same for win forms just a different interface. Hence when you see the term Presentation Layer ASP.NET, yours will be a Windows Form... Have a read.


Age is a consequence of experience
 
Great - I'll have a look in the week. I've also ordered a VS2005 book [surprise]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top