﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » GUID's As Primary Keys</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 25 Sep 2026 02:33:49 GMT</lastBuildDate><ttl>20</ttl><item><title>GUID's As Primary Keys</title><link>http://forum.strataframe.net/FindPost6146.aspx</link><description>The vast majority of our table schemas use GUID's (uniqueidentifiers) as their primary keys.&amp;nbsp; I am not able to save new entries back to the test table I am using and updates sometimes go through sometimes do not!&amp;nbsp; I have a simple form based on the Maintenance Form.&amp;nbsp;&amp;nbsp; Attached is the debug log I captured.&lt;/P&gt;&lt;P&gt;I did try to add code int he BO_BeforeAddNew proc that primes the GUID of the file:&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;Private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;FONT size=2&gt; IncdTypeBO_BeforeAddNew(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; e &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.Business.BeforeAddNewEventArgs) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Handles&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.BeforeAddNew&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.SQLGUID = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; System.Guid()&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;Which just brought up this most recent error as shown in the log.&amp;nbsp; Also I never heard back on the Radio button issue I posted yesterday.&amp;nbsp; The combo box appears to work now.&amp;nbsp; But for the life of me I cannot make the RadioButtonGrp/Options work with the BO.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff&gt;Ben&lt;FONT size=2&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description><pubDate>Tue, 30 Jan 2007 10:57:41 GMT</pubDate><dc:creator>Ben Kim</dc:creator></item><item><title>RE: GUID's As Primary Keys</title><link>http://forum.strataframe.net/FindPost6422.aspx</link><description>Just wanted to share this function as I use guid's as well. Here is a good article on using guids as Primary Keys. These function's&amp;nbsp;are somewhere in that article&amp;nbsp;in C# but I just made a vb version of it.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.informit.com/articles/article.asp?p=25862&amp;amp;rl=1"&gt;http://www.informit.com/articles/article.asp?p=25862&amp;amp;rl=1&lt;/A&gt;&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Shared&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/FONT&gt;&lt;FONT size=2&gt; NewSeqGuid() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; Guid&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; laGuid() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Byte&lt;/FONT&gt;&lt;FONT size=2&gt; = System.Guid.NewGuid.ToByteArray&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; ldBaseDate &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; DateTime = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; DateTime(1900, 1, 1)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; ldNow &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; DateTime = DateTime.Now&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;' Get the days and milliseconds which will be used to build the byte string &lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; strucdays &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; TimeSpan = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; TimeSpan((ldNow.Ticks - ldBaseDate.Ticks))&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; strucmsecs &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; TimeSpan = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; TimeSpan((ldNow.Ticks _&lt;/P&gt;&lt;P&gt;- (&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; DateTime(ldNow.Year, ldNow.Month, ldNow.Day).Ticks)))&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;' Convert to a byte array &lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;' Note that SQL Server is accurate to 1/300th of a millisecond so we divide by 3.333333 &lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; laDays() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Byte&lt;/FONT&gt;&lt;FONT size=2&gt; = BitConverter.GetBytes(strucdays.Days)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; laSecs() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Byte&lt;/FONT&gt;&lt;FONT size=2&gt; = BitConverter.GetBytes(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;CType&lt;/FONT&gt;&lt;FONT size=2&gt;((strucmsecs.TotalMilliseconds / 3.333333), &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Long&lt;/FONT&gt;&lt;FONT size=2&gt;))&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;' Reverse the bytes to match SQL Servers ordering &lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;Array.Reverse(laDays)&lt;/P&gt;&lt;P&gt;Array.Reverse(laSecs)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;' Copy the bytes into the guid &lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;Array.Copy(laDays, (laDays.Length - 2), laGuid, (laGuid.Length - 6), 2)&lt;/P&gt;&lt;P&gt;Array.Copy(laSecs, (laSecs.Length - 4), laGuid, (laGuid.Length - 4), 4)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Return&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; System.Guid(laGuid)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Shared&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/FONT&gt;&lt;FONT size=2&gt; GetDateFromSeqGuid(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; guid &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; System.Guid) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; DateTime&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; baseDate &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; DateTime = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; DateTime(1900, 1, 1)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; daysArray() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Byte&lt;/FONT&gt;&lt;FONT size=2&gt; = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Byte&lt;/FONT&gt;&lt;FONT size=2&gt;((4) - 1) {}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; msecsArray() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Byte&lt;/FONT&gt;&lt;FONT size=2&gt; = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Byte&lt;/FONT&gt;&lt;FONT size=2&gt;((4) - 1) {}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; guidArray() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Byte&lt;/FONT&gt;&lt;FONT size=2&gt; = guid.ToByteArray&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;' Copy the date parts of the guid to the respective byte arrays. &lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;Array.Copy(guidArray, (guidArray.Length - 6), daysArray, 2, 2)&lt;/P&gt;&lt;P&gt;Array.Copy(guidArray, (guidArray.Length - 4), msecsArray, 0, 4)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;' Reverse the arrays to put them into the appropriate order &lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;Array.Reverse(daysArray)&lt;/P&gt;&lt;P&gt;Array.Reverse(msecsArray)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;' Convert the bytes to ints &lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; days &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Integer&lt;/FONT&gt;&lt;FONT size=2&gt; = BitConverter.ToInt32(daysArray, 0)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; msecs &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Integer&lt;/FONT&gt;&lt;FONT size=2&gt; = BitConverter.ToInt32(msecsArray, 0)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; lddate &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; DateTime = baseDate.AddDays(days)&lt;/P&gt;&lt;P&gt;lddate = lddate.AddMilliseconds((msecs * 3.333333))&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Return&lt;/FONT&gt;&lt;FONT size=2&gt; lddate&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 30 Jan 2007 10:57:41 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: GUID's As Primary Keys</title><link>http://forum.strataframe.net/FindPost6208.aspx</link><description>There is a BeforeSave event on the business object...&lt;/P&gt;&lt;P&gt;If you want to exclude fields from the concurrency checking, you'll need to implement row versioning.&amp;nbsp; Add an extra column to the table that is an integer.&amp;nbsp; You can call it Version, RowVersion, prefix_Version, whatever, it just has to be an integer.&amp;nbsp; Then, change the UpdateConcurrencyType to OptimisticRowVersion and set the RowVersionOrTimestamp column to the name of that column.&amp;nbsp; The business object will handle the rest.&amp;nbsp; The trigger can then just ignore that column and the business object won't think there is a concurrency issue.&amp;nbsp; &lt;/P&gt;&lt;P&gt;You can also use a Timestamp column for concurrency, but in this case, the trigger would also modify that field since Timestamp columns are updated automatically by the system.</description><pubDate>Thu, 25 Jan 2007 09:10:15 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: GUID's As Primary Keys</title><link>http://forum.strataframe.net/FindPost6202.aspx</link><description>Apparently this has something to do with a trigger that is firing on the backend that our DBA established.&amp;nbsp; He is automatically updating the "SQLLASTUPDATED" and several other field values&amp;nbsp;in the table.&lt;/P&gt;&lt;P&gt;If I add &lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&lt;P&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;.SQLLastUpdated = Now&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;To the BO (only place that made sense was _CheckRulesOnCurrentRow - Shouldn't there be a BeforeSave in the BO?), it started working but the SQLLastUpdated column now always causes a "collison".&amp;nbsp; Is there anyway to ignore specific fields such as the SQLLastUpdated column when using concurrency checking?&amp;nbsp; IE:&amp;nbsp; I need all fields BUT the ones handle by the DBA's trigger.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Ben&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Thu, 25 Jan 2007 08:24:21 GMT</pubDate><dc:creator>Ben Kim</dc:creator></item><item><title>RE: GUID's As Primary Keys</title><link>http://forum.strataframe.net/FindPost6201.aspx</link><description>Attached find the debug log.&amp;nbsp; Maybe that will help.&lt;/P&gt;&lt;P&gt;Ben</description><pubDate>Thu, 25 Jan 2007 08:13:59 GMT</pubDate><dc:creator>Ben Kim</dc:creator></item><item><title>RE: GUID's As Primary Keys</title><link>http://forum.strataframe.net/FindPost6185.aspx</link><description>OK I have moved the code.&amp;nbsp; Now it allows me to save.&amp;nbsp; But when I update the record I just saved, I get the following error message:&lt;/P&gt;&lt;P&gt;BusinessLayerException&lt;BR&gt;&amp;nbsp;An error occurred while saving an the data to the server.&lt;BR&gt;DataLayerSavingException&lt;BR&gt;&amp;nbsp;Arithmetic operation resulted in an overflow.&lt;BR&gt;OverflowException&lt;BR&gt;&amp;nbsp;Arithmetic operation resulted in an overflow.&lt;/P&gt;&lt;P&gt;Source&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : MicroFour StrataFrame Business&lt;/P&gt;&lt;P&gt;Stack Trace: &lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Data.DataBasics.CompareDateTime(DateTime DateTime1, DateTime DateTime2)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Data.DataLayer.BuildFieldCollisions(DataRow ServerRow, DataRow LocalRow)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Data.DataLayer.HandleConcurrencyException(DataRow LocalRow)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Data.SqlDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler, Boolean RecreateCommand)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Data.DbDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Data.DataLayer.UpdateDataTableThread(Object ThreadParams)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Data.DataLayer.SaveByForm(DataTable TableToSave, Boolean Transactional, String TransactionKey)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Business.BusinessLayer.SaveByForm(Boolean Transactional, String TransactionKey)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save(Boolean Transactional, String TransactionKey)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save()&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.UI.Windows.Forms.MaintenanceFormToolStrip.cmdSave_Click(Object sender, EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ScrollableControl.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ToolStrip.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&lt;BR&gt;&lt;/P&gt;&lt;P&gt;Ideas?&lt;/P&gt;&lt;P&gt;Ben</description><pubDate>Wed, 24 Jan 2007 15:30:07 GMT</pubDate><dc:creator>Ben Kim</dc:creator></item><item><title>RE: GUID's As Primary Keys</title><link>http://forum.strataframe.net/FindPost6155.aspx</link><description>When you set the primary key for the record within the BeforeAddNew(), the record has not been added to the business object, yet.&amp;nbsp; You want to move that code to the SetDefaultValues() event handler (there should already be a method stub for it in the BO if it was created by the template).&amp;nbsp; The event sequence goes like this:&lt;/P&gt;&lt;P&gt;RaiseEvent BeforeAddNew&lt;/P&gt;&lt;P&gt;If Not e.Cancel Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Add new row&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RaiseEvent SetDefaultValues&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RaiseEvent AfterAddNew&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;Try changing that and see if that fixes it.</description><pubDate>Wed, 24 Jan 2007 10:04:02 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>