astrodestino
IS-IT--Management
Hi!
Thanks to SqeakingSweep I could manage to force to change everynull date value to date.now.
I'm not used to work with dataset and datareaders and datagrids but this time I got to use them and I need a hand.
This datagrid thing is a small (very small) part of the project and I cant skip it
I got this code:
Here the app will check for null date column values and replace them with date.now write all the datagrid changes to the database and will close the form but I got a problem, sometimes, when I delete one row it will rise an error here:
For Each r As DataRow In ds.Tables(0).Rows
If IsDBNull(r(mfecha)) Then r(mfecha) = Date.Now <- Error Here
Next
mfecha is date field name
And the error says
translated)
Cant have access to a deleted row information
My database has not required fields and it has 4 fields:
ID, text, binary & date. The only null field is Binary.
Is there anyway that can be fixed? It seems that it will check the deleted row too!
Thank you!!!!!
Thanks to SqeakingSweep I could manage to force to change everynull date value to date.now.
I'm not used to work with dataset and datareaders and datagrids but this time I got to use them and I need a hand.
This datagrid thing is a small (very small) part of the project and I cant skip it
I got this code:
Code:
Try
Dim SQLString As String, connstring As String
connstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & nombrebase & ";Persist Security Info=False"
SQLString = "Select * From " & tabla2
Dim DBDataAdapter As New OleDb.OleDbDataAdapter(SQLString, connstring)
Dim DBUpdateCommand As New OleDb.OleDbCommandBuilder(DBDataAdapter)
If mfecha <> "" Then
For Each r As DataRow In ds.Tables(0).Rows
''MsgBox(mfecha)
If IsDBNull(r(mfecha)) Then r(mfecha) = Date.Now
Next
End If
DBDataAdapter.Update(ds, tabla2)
Me.Close()
Catch Ex As Exception
MsgBox(Ex.Message)
End Try
For Each r As DataRow In ds.Tables(0).Rows
If IsDBNull(r(mfecha)) Then r(mfecha) = Date.Now <- Error Here
Next
mfecha is date field name
And the error says
Cant have access to a deleted row information
My database has not required fields and it has 4 fields:
ID, text, binary & date. The only null field is Binary.
Is there anyway that can be fixed? It seems that it will check the deleted row too!
Thank you!!!!!