﻿<?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 » WinForms (How do I?)  » WinForms Sample Error</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 10:51:43 GMT</lastBuildDate><ttl>20</ttl><item><title>WinForms Sample Error</title><link>http://forum.strataframe.net/FindPost1992.aspx</link><description>I was running the WinForms Sample and in Product Maintenance I clicked edit then select product picture. I chose and image which displayed so I clicked Save and got:&lt;br&gt;
BusinessLayerException&lt;br&gt;
	An error occurred while saving an the data to the server.&lt;br&gt;
DataLayerSavingException&lt;br&gt;
	The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.&lt;br&gt;
SqlException&lt;br&gt;
	The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.&lt;br&gt;
&lt;br&gt;
Source     : MicroFour StrataFrame Business&lt;br&gt;
&lt;br&gt;
Stack Trace: &lt;br&gt;
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)&lt;br&gt;
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)&lt;br&gt;
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)&lt;br&gt;
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)&lt;br&gt;
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()&lt;br&gt;
   at System.Data.SqlClient.SqlDataReader.get_MetaData()&lt;br&gt;
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)&lt;br&gt;
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)&lt;br&gt;
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)&lt;br&gt;
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)&lt;br&gt;
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)&lt;br&gt;
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)&lt;br&gt;
   at System.Data.Common.DbCommand.ExecuteReader()&lt;br&gt;
   at MicroFour.StrataFrame.Data.SqlDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler, Boolean RecreateCommand)&lt;br&gt;
   at MicroFour.StrataFrame.Data.DbDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler)&lt;br&gt;
   at MicroFour.StrataFrame.Data.DataLayer.UpdateDataTableThread(Object ThreadParams)&lt;br&gt;
   at MicroFour.StrataFrame.Data.DataLayer.SaveByForm(DataTable TableToSave, Boolean Transactional, String TransactionKey)&lt;br&gt;
   at MicroFour.StrataFrame.Business.BusinessLayer.SaveByForm(Boolean Transactional, String TransactionKey)&lt;br&gt;
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save(Boolean Transactional, String TransactionKey)&lt;br&gt;
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save()&lt;br&gt;
   at MicroFour.StrataFrame.UI.Windows.Forms.MaintenanceFormToolStrip.cmdSave_Click(Object sender, EventArgs e)&lt;br&gt;
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)&lt;br&gt;
   at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)&lt;br&gt;
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)&lt;br&gt;
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)&lt;br&gt;
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)&lt;br&gt;
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)&lt;br&gt;
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)&lt;br&gt;
   at System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)&lt;br&gt;
   at System.Windows.Forms.Control.WndProc(Message&amp; m)&lt;br&gt;
   at System.Windows.Forms.ScrollableControl.WndProc(Message&amp; m)&lt;br&gt;
   at System.Windows.Forms.ToolStrip.WndProc(Message&amp; m)&lt;br&gt;
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)&lt;br&gt;
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)&lt;br&gt;
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&lt;br&gt;</description><pubDate>Sun, 30 Jul 2006 18:17:39 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: WinForms Sample Error</title><link>http://forum.strataframe.net/FindPost2003.aspx</link><description>Oh.</description><pubDate>Sun, 30 Jul 2006 18:17:39 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: WinForms Sample Error</title><link>http://forum.strataframe.net/FindPost2002.aspx</link><description>No the VarBinary data type can be compared.&amp;nbsp; The reason it failed on your computer is because you deployed the sample database to SQL Server 2000, not SQL Server 2005.&amp;nbsp; The prod_image field is defined as a VarBinary(MAX) field, which can be compared just fine.&amp;nbsp; However, when the Sample database was deployed, the data type was changed to Image, and the business object still thinks it's a VarBinary field.</description><pubDate>Sun, 30 Jul 2006 17:47:10 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: WinForms Sample Error</title><link>http://forum.strataframe.net/FindPost1996.aspx</link><description>Maybe also need to test for SqlDbType.Binary?</description><pubDate>Sat, 29 Jul 2006 23:32:44 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: WinForms Sample Error</title><link>http://forum.strataframe.net/FindPost1995.aspx</link><description>Here's the patch--&lt;br&gt;
&lt;br&gt;
Module: SqlDataSourceItem.vb&lt;br&gt;
Routine: BuildUpdateCommand_NonSP&lt;br&gt;
Error: the datatype of the field is SqlDbType.VarBinary, not SqlDbType.Image&lt;br&gt;
Patch:&lt;br&gt;
&lt;br&gt;
         ElseIf QueryInfo.ConcurrencyType = ConcurrencyTypeOptions.OptimisticAllFields Then&lt;br&gt;
                For Each lcField In QueryInfo.Fields&lt;br&gt;
                    '-- Add the field to the query&lt;br&gt;
                    '-- Make sure the field is not an image field&lt;br&gt;
                    Try&lt;br&gt;
                        loType = CType(QueryInfo.FieldNativeDbTypes(lcField), SqlDbType)&lt;br&gt;
---&gt;                  If loType = SqlDbType.Image Or loType = SqlDbType.VarBinary Then&lt;br&gt;
                            Continue For&lt;br&gt;
                        End If&lt;br&gt;
                    Catch ex As Exception&lt;br&gt;
                        loType = SqlDbType.VarChar&lt;br&gt;
                    End Try&lt;br&gt;</description><pubDate>Sat, 29 Jul 2006 23:30:27 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item></channel></rss>