Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
405
Cannot perform 'Like' operation on System.Double and System.String.
posted

Have a webcombo using a SqlDataSource (in the *.aspx - not using InitializeDataSource or binding from C#)

ComboTypeAhead="Suggest"

DataValueField="Version"

The stored procedure used by the webcombo returns Version with data type = FLOAT

When I type something in the webcombo, it does not filter based on the typed value.

Then when I click a button. I get the error (details below - please advise)

Cannot perform 'Like' operation on System.Double and System.String.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.EvaluateException: Cannot perform 'Like' operation on System.Double and System.String.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:

[EvaluateException: Cannot perform 'Like' operation on System.Double and System.String.]
   System.Data.BinaryNode.SetTypeMismatchError(Int32 op, Type left, Type right) +21
   System.Data.LikeNode.Eval(DataRow row, DataRowVersion version) +451
   System.Data.DataExpression.Invoke(DataRow row, DataRowVersion version) +81
   System.Data.Index.AcceptRecord(Int32 record, IFilter filter) +103
   System.Data.Index.InitRecords(IFilter filter) +214
   System.Data.Index..ctor(DataTable table, Int32[] ndexDesc, IndexField[] indexFields, Comparison`1 comparison, DataViewRowState recordStates, IFilter rowFilter) +414
   System.Data.DataTable.GetIndex(IndexField[] indexDesc, DataViewRowState recordStates, IFilter rowFilter) +240
   System.Data.DataView.UpdateIndex(Boolean force, Boolean fireEvent) +165
   System.Data.DataView.UpdateIndex(Boolean force) +12
   System.Data.DataView.SetIndex2(String newSort, DataViewRowState newRowStates, IFilter newRowFilter, Boolean fireEvent) +113
   System.Data.DataView.SetIndex(String newSort, DataViewRowState newRowStates, IFilter newRowFilter) +17
   System.Data.DataView.set_RowFilter(String value) +170
   Infragistics.WebUI.UltraWebGrid.DBBinding.ProcessDataViewForFillRows(DataView dataView, RowsCollection rows) +570
   Infragistics.WebUI.UltraWebGrid.DBBinding.FillRows(UltraWebGrid grid, RowsCollection rows, IEnumerable datasource) +303
   Infragistics.WebUI.UltraWebGrid.DBBinding.BindList(IEnumerable datasource) +3012
   Infragistics.WebUI.UltraWebGrid.DBBinding.DataBind(Object dataSource, String dataMember) +2050
   Infragistics.WebUI.UltraWebGrid.UltraWebGrid.DataSourceViewSelectCallBack(IEnumerable dataSource) +131
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31
   Infragistics.WebUI.UltraWebGrid.UltraWebGrid.DataBind() +1429
   Infragistics.WebUI.UltraWebGrid.UltraWebGrid.LoadPostData(String postDataKey, NameValueCollection values) +5515
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +693
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1743

 --------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082

  • 155
    Suggested Answer
    posted

    Hi ,

    WebCombo Filter only for string data type only, so you must change the query like as " select convert(id,varchar) id from emp" and you also return the procdeure as string.

    Regards,

    Kannan.S