Guid PrimeKey as Row Guid for Replication


Author
Message
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

I am thinking on this issue also. My initial plan to to auto add PK (if is row guid) to excluded update field list.



Any comment?
Paul Chase
Paul Chase
Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
I am using Guid's a Primary Keys and also as Rowguid's for replication. The issue is on update's, If a field is specifed as rowguid it cannot be updated so the update fails.

I made the following changes to make this work can you please add to your code so I dont break at next update? or let me know how and what you want to change so I dont get a suprise next update Smile

Thanks

Paul

To Business layer I added this Property. (with a private as well)

''' <summary>

''' Gets or sets a value that determines whether the primary key for this business object is

''' a RowGuid

''' </summary>

''' <value></value>

''' <returns></returns>

''' <remarks></remarks>

<Category(EDITOR_CATEGORY_CRUD), _

DefaultValue(True), _

Description("Determines whether the primary key for this business object is a RowGuid.")> _

Public Property PrimaryKeyIsRowGuid() As Boolean

Get

Return Me._PrimaryKeyIsRowGuid

End Get

Set(ByVal value As Boolean)

Me._PrimaryKeyIsRowGuid = value

End Set

End Property

 

And in Data Layer

In method BuildUpdateInfo aroung line 573

'----------------------> Paul made a change the code here from

'--this

'-- Add the pk field to the fields to update if the primary key if not

' auto incremented

' If Not Me._BusinessObject.PrimaryKeyIsAutoIncremented Then

' loInfo.Fields.Add(lcFieldName)

' End If

'---> to

'-- Add the pk field to the fields to update if the primary key if not

' auto incremented or Row-Guid

If Not Me._BusinessObject.PrimaryKeyIsAutoIncremented AndAlso Not Me._BusinessObject.PrimaryKeyIsRowGuid Then

loInfo.Fields.Add(lcFieldName)

End If


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search