J
JeremyGrand
I've read what's available here, but can't seem to make this work right. I'm
experimenting with components on a form, although I'd rather create the
pieces & assemble them in code, but that's another issue entirely.
I have a table in sql2k with an autoincrement column as primary index. It
also has a changeDate column with a trigger that updates to current datetime
when any column other than itself is changed.
Made a new form, followed Cor's tip & used Data to add a datasource.
Attached the bindingsource to the grid. To save the data, I'm doing this:
Private Sub DataGridView1_RowLeave(ByVal sender As Object, ByVal e As _
System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.RowLeave
Try
Me.Validate()
Me.MoveTicketCrossReferenceBindingSource.EndEdit()
Me.MoveTicketCrossReferenceTableAdapter.Update(Me.MyDataset.MoveTicketCrossReference)
Catch ex As Exception
End Try
end sub
I can now view & edit the data, most of the time. But,
- the trigger usually does not fire, although sometimes it updates every row
with an identical date.
- The grid does not refresh -- gotta exit & open it.
- The autoincrement field increments up every time you enter the (*) row &
leave it, resulting in gaps in the primary index.
- Me.MoveTicketCrossReferenceBindingSource.Current is not recognized as a
property. I'd like to look at it to see whether certain things need to be
done.
experimenting with components on a form, although I'd rather create the
pieces & assemble them in code, but that's another issue entirely.
I have a table in sql2k with an autoincrement column as primary index. It
also has a changeDate column with a trigger that updates to current datetime
when any column other than itself is changed.
Made a new form, followed Cor's tip & used Data to add a datasource.
Attached the bindingsource to the grid. To save the data, I'm doing this:
Private Sub DataGridView1_RowLeave(ByVal sender As Object, ByVal e As _
System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.RowLeave
Try
Me.Validate()
Me.MoveTicketCrossReferenceBindingSource.EndEdit()
Me.MoveTicketCrossReferenceTableAdapter.Update(Me.MyDataset.MoveTicketCrossReference)
Catch ex As Exception
End Try
end sub
I can now view & edit the data, most of the time. But,
- the trigger usually does not fire, although sometimes it updates every row
with an identical date.
- The grid does not refresh -- gotta exit & open it.
- The autoincrement field increments up every time you enter the (*) row &
leave it, resulting in gaps in the primary index.
- Me.MoveTicketCrossReferenceBindingSource.Current is not recognized as a
property. I'd like to look at it to see whether certain things need to be
done.