auto saving to access database
I have a datagrid that is bound via a datasource to an access database , i want the gird to autosave to the row changed in the gird to the database without clicking the save button in the toolbar that appears when you drag a datagrid onto a form , can anyone tell me how this is achievable , or even better a small simple downloadable project that I can have a look at
thanks
Re: auto saving to access database
You could use a timer control set at some interval like 5 minutes. Then in its timer event procedure you could call the .PerformClick event of the save button.
Re: auto saving to access database
hmmm thanks , I mean when you leave the row that you are editing then the row you have been editing gets saved without having to press the save button
do you know how this is achievable
Re: auto saving to access database
Use the rowLeave event to save the row.
vb Code:
Private Sub DataGridView1_RowLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.RowLeave
End Sub
Re: auto saving to access database
You could use the IsRow Dirty on RowLeave to Call the update
Re: auto saving to access database
hi thanks for the replies this is what I am looking for
but could you help me a bit more with the code
so using
Private Sub DataGridView1_RowLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.RowLeave
'then see if row is dirty - this is the bit I am stuck on
if isrow dirty then
'call save button click event
end if
End Sub
the bit I am having a problem with is finding out if the row is dirty or not as isrow dirty is not compiling , what is the syntax for finding out if the row is dirty in this sub routine ?
thanks
Re: auto saving to access database
This should do it for you ;)
Code:
If DataGridView1.IsCurrentRowDirty Then