Troubleshooting a SaveByForm Error


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
I added a new field to a table yesterday (very minor change).  After utilizing the BOM to update the BO, I rebuilt the app, then added the field to a maintenance form so that it could be updated.  The app was deployed.  Error reports started coming in this morning.  I am getting the following (all I do is click edit, then immediately click save. . . no changes to the data):

Stack Trace:
at MicroFour.StrataFrame.Business.BusinessLayer.SaveByForm(Boolean Transactional, String TransactionKey)
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save(Boolean Transactional, String TransactionKey)
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save()
   at MicroFour.StrataFrame.UI.Windows.Forms.MaintenanceFormToolStrip.cmdSave_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)

Inner Exception (same as Source):
MicroFour StrataFrame Business

Message:
An error occurred while saving an the data to the server.

The error does not give me much to go on.  What are some ways that I could troubleshoot this error?

Thanks,
Bill

Replies
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
I opened the SF source code solution, built it in debug mode (already selected) and received no errors.  I ran the AfterBuild.bat file and got a ton of files added to the source folder (odd).  I closed VS and when I reopened, I got a message about the SF add-in not loading.  I said 'No' to remove it.  But now, I have no SF menu.  I closed and reopened VS.  No dice.  SF menu is gone.  What do I need to do, now?
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
You should not have run the AfterBuild.bat manually...I have no idea what all may have happened if you did.  This is part of the Post Build events.

Just manually drag the SF assemblies into the GAC, you may want to delete the source and re-extract it so you don't have a bunch of junk in it.  You may also have to fix your StrataFrame.Addin file.  It will be in the following location on Vista:

C:\Users\YourUserName\AppData\Roaming\Microsoft\MSEnvShared\AddIns

And the contents will look something like this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Extensibility xmlns="http://schemas.microsoft.com/AutomationExtensibility">
 <HostApplication>
  <Name>Microsoft Visual Studio Macros</Name>
  <Version>9.0</Version>
 </HostApplication>
 <HostApplication>
  <Name>Microsoft Visual Studio</Name>
  <Version>9.0</Version>
 </HostApplication>
 <Addin>
  <FriendlyName>StrataFrame Add-In Manager</FriendlyName>
  <Description>Adds extended functionality to the Visual Studio development environment for teh MicroFour StrataFrame Application Framework and Database Management Toolkit.</Description>
  <AboutBoxDetails>For more information about MicroFour StrataFrame, visit our website at\rhttp://www.strataframe.net\rCopyright (c) 2005 MicroFour, Inc. Inc.</AboutBoxDetails>
  <Assembly>C:\Program Files\Common Files\MicroFour\StrataFrame\MicroFour StrataFrame AddIns.dll</Assembly>
  <FullClassName>MicroFour.StrataFrame.AddIns.AddInManager</FullClassName>
  <LoadBehavior>1</LoadBehavior>
  <CommandPreload>0</CommandPreload>
  <CommandLineSafe>0</CommandLineSafe>
 </Addin>
</Extensibility>

Depending upon how you answered the question when the failed add-in message came up, you will either need to set the LoadBehavior back to 1 or rename the add-in file (usually just need to remove the underscore).

Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Ok.  Got it going, again.  And, my code is now debugging into the source code.  This is what I get:

MicroFour.StrataFrame.Business.BusinessLayerException was unhandled by user code
  Message="An error occurred while saving an the data to the server."
  Source="MicroFour StrataFrame Business"
  StackTrace:
       at MicroFour.StrataFrame.Business.BusinessLayer.SaveByForm(Boolean Transactional, String TransactionKey)    at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save(Boolean Transactional, String TransactionKey)    at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save()    at MicroFour.StrataFrame.UI.Windows.Forms.MaintenanceFormToolStrip.cmdSave_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)
  InnerException: MicroFour.StrataFrame.Data.DataLayerSavingException
       Message="A severe error occurred on the current command.  The results, if any, should be discarded. A severe error occurred on the current command.  The results, if any, should be discarded."
       Source="MicroFour StrataFrame Business"
       StackTrace:
            at MicroFour.StrataFrame.Data.DataLayer.UpdateDataTable(DataTable TableToUpdate, Boolean Transactional, String TransactionKey)    at MicroFour.StrataFrame.Data.DataLayer.SaveByForm(DataTable TableToSave, Boolean Transactional, String TransactionKey)    at MicroFour.StrataFrame.Business.BusinessLayer.SaveByForm(Boolean Transactional, String TransactionKey)
       InnerException: System.Data.SqlClient.SqlException
            Class=11
            ErrorCode=-2146232060
            LineNumber=0
            Message="A severe error occurred on the current command.  The results, if any, should be discarded. A severe error occurred on the current command.  The results, if any, should be discarded."
            Number=0
            Procedure=""
            Server="SQL_SERVER"
            Source=".Net SqlClient Data Provider"
            State=0
            StackTrace:
                 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)
            InnerException:

It is "bombing" at line 4493 of businesslayer.vb (BusinessLayer Class).  I am looking into the SqlClient error to see if anything stands out there.

Bill

Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Like you said, Trent, the error could be caused by many different things.  I determined that the field itself was not correctly typed.  The new field was added as an nvarchar(4000) (SQL Server 2000).  Apparently, this does not like to play nicely with other data types in the neighborhood.  After changing it to varchar(800), the SaveByForm method worked perfectly.  Users can now save their data.  Oh, they are so happy, now!  Some are doing the riverdance in the hallways.  I think I will join them.  Hehe
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Glad you got it figured out! Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Bill Cunnien - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Bill Cunnien - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Bill Cunnien - 17 Years Ago
                         [quote]I have a C# application with the source code attached to my...
Trent L. Taylor - 17 Years Ago
                             I opened the SF source code solution, built it in debug mode (already...
Bill Cunnien - 17 Years Ago
                                 You should not have run the AfterBuild.bat manually...I have no idea...
Trent L. Taylor - 17 Years Ago
                                     Ok. Got it going, again. And, my code is now debugging into the source...
Bill Cunnien - 17 Years Ago
                                         Like you said, Trent, the error could be caused by many different...
Bill Cunnien - 17 Years Ago
                                             Glad you got it figured out! :)
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search