Deleting images from a RichTextBox


Author
Message
Juan Carlos Pazos
Juan Carlos Pazos
StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)
Group: Forum Members
Posts: 144, Visits: 227
Hi



I use the RichTextBox control in one form, is bounded to a nvarchar(max) field by the BO. The property is set to RFT.



Works great with text, but for testing I add a picture to the RTF, this because the also have a RichTextBoxToolStrip tah has an Image insert function.



The image is added corrctly and can be showed without problems, but if I try to delete the image or make any chaneg to the text I get this error:



BusinessLayerException

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

DataLayerSavingException

String or binary data would be truncated.

The statement has been terminated.

SqlException

String or binary data would be truncated.

The statement has been terminated.



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)



Hope you can help me in how to use this?



Regards




Smile Everything is possible, just keep trying...
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Juan Carlos Pazos - 16 Years Ago
Trent L. Taylor - 16 Years Ago
Juan Carlos Pazos - 16 Years Ago
Trent L. Taylor - 16 Years Ago
                     Hello, could it have something to do with how the...
Ralph Rutschmann - 16 Years Ago
                         That is a good suggestion and could very well cause a problem. Good...
Trent L. Taylor - 16 Years Ago
                             Ralph, Trent Thanks, changing the concurrency type all works without...
Juan Carlos Pazos - 16 Years Ago
                                 Ralph, Trent

Thanks, changing the concurrency type to...
Juan Carlos Pazos - 16 Years Ago
                                     Juan,

Handling concurrency is very easy. You need to do...
Greg McGuffey - 16 Years Ago
                                         Greg

Thanks for the advise, I did that before, the...
Juan Carlos Pazos - 16 Years Ago
Dustin Taylor - 16 Years Ago
Juan Carlos Pazos - 16 Years Ago
Dustin Taylor - 16 Years Ago
Juan Carlos Pazos - 16 Years Ago
Dustin Taylor - 16 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search