|
Group: Forum Members
Posts: 235,
Visits: 309
|
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
No the VarBinary data type can be compared. The reason it failed on your computer is because you deployed the sample database to SQL Server 2000, not SQL Server 2005. The prod_image field is defined as a VarBinary(MAX) field, which can be compared just fine. 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.
|
|
Group: Forum Members
Posts: 235,
Visits: 309
|
Maybe also need to test for SqlDbType.Binary?
|
|
Group: Forum Members
Posts: 235,
Visits: 309
|
Here's the patch--
Module: SqlDataSourceItem.vb
Routine: BuildUpdateCommand_NonSP
Error: the datatype of the field is SqlDbType.VarBinary, not SqlDbType.Image
Patch:
ElseIf QueryInfo.ConcurrencyType = ConcurrencyTypeOptions.OptimisticAllFields Then
For Each lcField In QueryInfo.Fields
'-- Add the field to the query
'-- Make sure the field is not an image field
Try
loType = CType(QueryInfo.FieldNativeDbTypes(lcField), SqlDbType)
---> If loType = SqlDbType.Image Or loType = SqlDbType.VarBinary Then
Continue For
End If
Catch ex As Exception
loType = SqlDbType.VarChar
End Try
|
|
Group: Forum Members
Posts: 235,
Visits: 309
|
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:
BusinessLayerException
An error occurred while saving an the data to the server.
DataLayerSavingException
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
SqlException
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
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.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.Data.DataLayer.SaveByForm(DataTable TableToSave, Boolean Transactional, String TransactionKey)
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)
|