Trouble changing an imported DDT


Author
Message
Jason Seidell
Jason Seidell
StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)
Group: Forum Members
Posts: 59, Visits: 180
I tried to take my code home to work on it over the weekend, since I don't have a VPN I bundled all the files on to my portable drive and went home.  Then came the frustrating realization, I need to also backup/restore the Strataframe database or else I have to rebuild all the DDT and BO customization, etc.  Anyways I digress, and on to the problem at hand.

I restored my database structure on my machine at home, and had to re-create the DDT using database import.  However on one of my tables it keeps failing with this error:

DataLayerSavingException
  The INSERT statement conflicted with the FOREIGN KEY constraint "fk_indexes_indexfields". The conflict occurred in database "StrataFrame", table "dbo.DBEIndexes", column 'idx_pk'.
The statement has been terminated.
SqlException
  The INSERT statement conflicted with the FOREIGN KEY constraint "fk_indexes_indexfields". The conflict occurred in database "StrataFrame", table "dbo.DBEIndexes", column 'idx_pk'.
The statement has been terminated.

Source     : MicroFour StrataFrame Business

Stack Trace:
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at MicroFour.StrataFrame.Data.DbDataSourceItem.InternalExecuteReader(DbCommand Command, Boolean IsTransactional, String TransactionKey)
   at MicroFour.StrataFrame.Data.SqlDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler, Boolean RecreateCommand)
   at MicroFour.StrataFrame.Data.DbDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler)
   at MicroFour.StrataFrame.Data.DataLayer.UpdateDataTableThread(Object ThreadParams)
   at MicroFour.StrataFrame.Business.BusinessLayer.Save(Boolean Transactional, String TransactionKey)
   at MicroFour.StrataFrame.Business.BusinessLayer.Save()
   at MicroFour.StrataFrame.Data.TableStructure.CreatePrimaryKeyIndex()
   at MicroFour.StrataFrame.Data.TableStructure.TableStructure_AfterSave(AfterSaveUndoByFormEventArgs e)
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.InvokeAfterSave(AfterSaveUndoByFormEventArgs e)
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.RaiseAfterSaveEvent(AfterSaveUndoByFormEventArgs e)
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save(Boolean Transactional, String TransactionKey)
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save()
   at MicroFour.StrataFrame.Data.TableStructure.SaveChanges(Boolean CloseForm)
   at MicroFour.StrataFrame.Data.TableStructure.cmdSaveAndClose_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
   at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

This error can be recreated by restoring the attached database file, then going into DDT and import the database to a new project, then try to modify the table Segments (You don't even have to really change anything just open and then try to click save.)  I tried to trace the problem by looking at the SQL tables for the indexes and fields but I can't figure out what is causing the problem.

TiY

Jason

PS. Any thoughts to making a backup program that with one click would let you copy your source code, program database, and neccessary SF tables to a backup drive??

Jason Seidell

Programmer/Analyst

Infinedi

Attachments
FileValidator-FullBackup.zip (137 views, 154.00 KB)
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Do you by chance happen to have a GUID pk on one of the tables that is also set as the RowGuid?
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
I was able to restore the database, but it doesn't tell me much on the DDT.  Is there a way that you could backup your StrataFrame database?  The database that you posted was the deployed database, which doesn't contain the meta-data structures for the DDT.
Jason Seidell
Jason Seidell
StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)
Group: Forum Members
Posts: 59, Visits: 180
No I don't have any GUID keys, all the keys on the databases I created are auto-incrementing integers or a combination of two fields (but I was having issues with using two fields so I was changing them to integers and then just adding a unique index on those two fields).

Jason Seidell

Programmer/Analyst

Infinedi

Jason Seidell
Jason Seidell
StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)
Group: Forum Members
Posts: 59, Visits: 180
I will get you a copy of the strataframe database later today, I had the express version of SQL management studio installed and trying to upgrade to the full version and it's giving me problems.

Thanks

Jason Seidell

Programmer/Analyst

Infinedi

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Paul Chase ran into the same problem and as it turned out, he had an index on his table that was named the same thing as the index that the DDT was trying to automatically create for the table.  So, delete that index under the table called PK_[TableName], modify the structure of the table (just choose modify so that the window is opened) and "Save and Close" it and it should fix it.
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