M
Mr. B
I have a master DataSet... I then select (filter) some items and display them
on a 2nd DataGrid for editing (only the 6th column gets any editing).
The following code works fine. BUT what it does not do is check for a Zero
(not a Null) value. I know I can do a search for the 7 rows (maximum) in
column #6 for a Zero and reject the entry (and give a message box)? But I
think it would be under the 'not best coding' flag.
I know I could do an IF THEN kind of check for each column #6 in each row.
But IS there a simpler way?
My current code (for accepting a Row Deletion and Edit of Column #6) is as
follows:
If DsEditData.HasChanges Then
Try
Dim exDataModified, exDataDeleted As Integer
' Edit Hours
exDataDeleted = daEditData.Update(DsEditData.tblTimeEntry)
' Delete Row
exDataModified += daEditData.Update(DsEditData.tblTimeEntry.Select("",
"", DataViewRowState.Deleted))
Catch ex As Exception
MessageBox.Show(ex.Message, "Update failed!", MessageBoxButtons.OK,
MessageBoxIcon.Error)
End Try
Else
MessageBox.Show("No Changes Made!", "SubmitChanges",
MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
Any tips appreciated.
Regards,
Bruce
on a 2nd DataGrid for editing (only the 6th column gets any editing).
The following code works fine. BUT what it does not do is check for a Zero
(not a Null) value. I know I can do a search for the 7 rows (maximum) in
column #6 for a Zero and reject the entry (and give a message box)? But I
think it would be under the 'not best coding' flag.
I know I could do an IF THEN kind of check for each column #6 in each row.
But IS there a simpler way?
My current code (for accepting a Row Deletion and Edit of Column #6) is as
follows:
If DsEditData.HasChanges Then
Try
Dim exDataModified, exDataDeleted As Integer
' Edit Hours
exDataDeleted = daEditData.Update(DsEditData.tblTimeEntry)
' Delete Row
exDataModified += daEditData.Update(DsEditData.tblTimeEntry.Select("",
"", DataViewRowState.Deleted))
Catch ex As Exception
MessageBox.Show(ex.Message, "Update failed!", MessageBoxButtons.OK,
MessageBoxIcon.Error)
End Try
Else
MessageBox.Show("No Changes Made!", "SubmitChanges",
MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
Any tips appreciated.
Regards,
Bruce