Richard Griffiths
unread,Oct 6, 2009, 12:37:08 PM10/6/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to CslaGenerator
Hi
using 3.5 templates I think I there may be a bug - are you able to
verify.
Following Rocky's PTracker project using the Apply button twice on a
form causes an error as the sp can't find the record to update the
second time round - as the last changed has not been updated
correctly.
The following line (from snippet below) does not bring back the latest
lastchanged value (after first update)....
cmd.Parameters.AddWithValue("@LastChanged", ReadProperty
(LastChangedProperty))
after it should have been updated by this line....
m_lastChanged = DirectCast(cmd.Parameters("@NewLastChanged").Value,
Byte())
Protected Overrides Sub DataPortal_Update()
Using ctx = ConnectionManager(Of SqlConnection).GetManager
(Database.ITASConnection, TRue)
Using cmd As New SqlCommand("usp_Client_Update", ctx.Connection)
If MyBase.IsDirty Then
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddWithValue("@LastChanged",
ReadProperty(LastChangedProperty))
DoInsertUpdate(cmd)
cmd.ExecuteNonQuery()
LoadProperty(LastChangedProperty, DirectCast
(cmd.Parameters("@NewLastChanged").Value, Byte()))
m_lastChanged = DirectCast(cmd.Parameters
("@NewLastChanged").Value, Byte())
End If
End Using
End Using
End Sub
It works if I change this.....
cmd.Parameters.AddWithValue("@LastChanged", ReadProperty
(LastChangedProperty))
to
cmd.Parameters.AddWithValue("@LastChanged", m_lastChanged ) or
I change this line....
m_lastChanged = DirectCast(cmd.Parameters("@NewLastChanged").Value,
Byte())
to....
LoadProperty(LastChangedProperty, DirectCast(cmd.Parameters
("@NewLastChanged").Value, Byte()))
Do you have any thoughts on this - can you verify if this is a bug?
Thanks
Richard