error when performing an add in a maintenance form


Author
Message
Felix M Avendano
Felix M Avendano
StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)
Group: Forum Members
Posts: 48, Visits: 1.5K
When I perform an add at the maintenance form I get an error message. I bounded a field at the BOM with a primary key and is still happening an error, is diferent than if you dont have any PK declared at the BOM, and this comes from the Data base itself (because is spanish). The error says that you cant insert a null value at the PK (thats true), but I m filling the field at the form after pressing the save button, so there is a value at the text box. 

It seems that when I save, is not passing any values from the textboxes to the DB.

BusinessLayerException
  An error occurred while saving an the data to the server.
DataLayerSavingException
  No se puede insertar el valor NULL en la columna 'empresaID', tabla 'portalagropecuario.dbo.Empresas'. La columna no admite valores NULL. Error de INSERT.
Se terminó la instrucción.
SqlException
  No se puede insertar el valor NULL en la columna 'empresaID', tabla 'portalagropecuario.dbo.Empresas'. La columna no admite valores NULL. Error de INSERT.
Se terminó la instrucción.

Source     : MicroFour StrataFrame Business

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

Felix M Avendano
Felix M Avendano
StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)StrataFrame Novice (62 reputation)
Group: Forum Members
Posts: 48, Visits: 1.5K
I ve put an autoincrement in the PK and it works fine. The question is, what if I don t want to use autoincrement.w00t 
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Felix,

Take a look at the following thread which deal with the same issue you are having: http://forum.strataframe.net/Topic15854-6-1.aspx?Highlight=autoincrement

Edhy Rijo

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