For example, I have an Int32 primary key called "CustomerID" and I set the value in SetDefaultValues() and the value is unique. I call BO.Add() which sets the value of CustomerID. I check the value of BO.CustomerID and it is correctly set to a valid value. However, when I do BO.Save() the CustomerID field is not written back to the SQL database (I can see this in SQL Profiler).
I have tried setting PrimaryKeyIsUpdatable to true but I guess I haven't done it correctly as Save() never writes the primary key.
Can anyone help?
Thanks in advance.
Wow Paul, thanks for sharing this info with us.
My next VFP conversion project will definately make use of this code since the use of a GUID PK is a must.
About the above comment, would you mind explaining a bit more about how to use SQL merge replication I also have those needs for my next conversion project.
Here is a step-by-step on setting up Merge Replication. Just serach on Google for about 1000 more articles.
http://www.databasejournal.com/features/mssql/article.php/1438231
And Paul is right on the sequential GUIDs...that is definitely the safest route to go.
Thanks Trent.
Just like the decision to use integer or guid primary keys it really depends' on your business requirements as to what replication scenario would work best for you. Also do not forget that StrataFrame has the Enterprise Server which may be a better option again depending on what your requirements are.
Paul
While we are on the subject, does the Database Deployment Toolkit support upgrading of replicated databases?
I like the idea of sequential GUIDs but does this still guarantee they will be globally unique?