iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
I got a error from my webservice like this "Operator or incompatible with operand types Boolean and String" when i try to add a AdditionalSearchFields.
Can anyone tell me whats going wrong please. Thanks a lot.
Don.,
Hi Yogoo,
I can replicate your issue in our local end. Unfortunately, when using WebService, you could use AdditionalSearchFields property inside WebCombo but you should filter the data inside WebService. You can input the filter expression in DataSourceSelectArguments. Here's the example:
[WebMethod] public QueryResult GetCustomers(DataSourceSelectArguments selectArguments) { NorthwindDataContext context = new NorthwindDataContext(); context.DeferredLoadingEnabled = false; context.ObjectTrackingEnabled = false; string param; if(selectArguments.FilterExpression.Contains("like")) { param = selectArguments.FilterExpression.Split('\'')[1]; selectArguments.FilterExpression = "([ContactName] like '" + param + "' or [Address] like '" + param + "')"; } WebComboDataProvider<Customer> query = new WebComboDataProvider<Customer>(context.Customers); return query.Select(selectArguments); }
Using that expression, I persist WebCombo to filter the value using ContactName and Address regarding the input that you put inside WebCombo. Please let me know if this matter still happen in your local end. I'll gladly help you to resolve it. Hope this helps.
Regards,Bernard
Hi Bernard,
Thanks for your reply.
Below is some of my code sample:
The AdditionalSearchFields="" is working fine, but got error if i change it to AdditionalSearchFields="Name".
My webcomb code:
<ISWebCombo:WebCombo ID="wCombo1" runat="server" DataTextField="Code" DataValueField="ID" Height="22px " Width="200px" DropDownRows="20" AdditionalSearchFields="Name" AllowWildCardSearch = "True" DataMember="" AllowAutoPostback="True" BindingOperationMode="ClientBinding" UseDefaultStyle="True"> <Columns> <ISWebCombo:WebComboColumn BaseFieldName="Code" HeaderText="Code" Name="Code" width = "50" /> <ISWebCombo:WebComboColumn BaseFieldName="Name" HeaderText="Name" Name="Name" width = "50" /> <ISWebCombo:WebComboColumn BaseFieldName="RefCode" HeaderText="R. Code" Name="R. Code" width = "50" /> <ISWebCombo:WebComboColumn BaseFieldName="Addr1" HeaderText="Addr1" Name="Addr1" width = "200" /> <ISWebCombo:WebComboColumn BaseFieldName="Remark" HeaderText="Remark" Name="Remark" width = "200" /> </Columns> <LayoutSettings ComboMode="MultipleColumns" SearchIconMode="Graphic" SearchImage="Search_XPBlue.gif"><HeaderStyle BackColor="#4D6185" Font-Names="segoe ui,tahoma" Font-Size="8pt" ForeColor="White" BackColor2="199, 223, 255" GradientType="Vertical" Height="20px"><Padding Bottom="3px" Left="3px" Right="3px" Top="3px" /><BorderSettings > <Bottom Color="101,147,207" Style="solid" Width="1px" /><Right Color="AliceBlue" Style="solid" Width="1px" /></BorderSettings></HeaderStyle><DropDownStyle><Active BaseStyle="Over" BackgroundImage="url(/CommonLibrary/Images/DD4_Active.gif)" ></Active><Over BaseStyle="Normal" BackgroundImage="url(/CommonLibrary/Images/Vis_DDActive.gif)" ForeColor="#6C8DC7" CustomRules="filter: Alpha(opacity=100)"><BorderSettings><Left Color="40, 106, 155" Style="Solid" Width="1px" /></BorderSettings></Over><Normal Cursor="Hand" Font-Names="Arial" Font-Size="0pt" ForeColor="White" Height="20px" Width="16px" BackgroundImage = "url(/CommonLibrary/Images/Vis_DDNormal.gif)" CustomRules="background-repeat:no-repeat"><Padding Bottom="2px" Left="0px" Right="1px" Top="0px" /></Normal></DropDownStyle><TextBoxStyle><Active BaseStyle="Over"></Active><Over BaseStyle="Normal"></Over><Normal BackColor="Transparent" BorderStyle="None" BorderWidth="0px" CustomRules="background:transparent;background:transparent;background:transparent;background:transparent" Font-Names="segoe ui,tahoma" Font-Size="8pt" ForeColor="Black" Height="20px" Width="180px"></Normal></TextBoxStyle><ResultFrameStyle BackColor="White" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px"></ResultFrameStyle><ColumnStyle CustomRules="text-overflow:ellipsis" Overflow="Hidden" OverflowX="Hidden" OverflowY="Hidden"><Padding Left="3px" Right="3px" /></ColumnStyle><FrameStyle><Active BaseStyle="Over" BackColor="WhiteSmoke"></Active><Over BaseStyle="Normal" BackColor="WhiteSmoke" BorderColor="#4D6185"></Over><Normal BackColor="White" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" Height="20px" Width="200px"></Normal></FrameStyle><MoreButtonStyle><Active BaseStyle="Over"></Active><Over BackColor="#E9EBF4" BaseStyle="Normal" BorderColor="Silver"></Over><Normal BorderColor="White" BorderStyle="Solid" BorderWidth="1px"></Normal></MoreButtonStyle><StatusBoxStyle BackColor="#4D6185" Font-Names="segoe ui,tahoma" Font-Size="8pt" ForeColor="White"></StatusBoxStyle><ResultBoxStyle Font-Names="segoe ui,tahoma" Font-Size="8pt"></ResultBoxStyle><RowStyle><Over BackColor="WhiteSmoke" BaseStyle="Normal"></Over><Normal BackColor="White" Height="20px"></Normal></RowStyle><SelectedRowStyle BackColor="#404040" Font-Names="Verdana" Font-Size="8pt" ForeColor="White" Height="20px" /></LayoutSettings> <ClientBindingSettings DataSourceType="WebService" ServiceUrl="http://localhost:1406/WanTech_WebService/WTService.asmx"> <ServiceMethods SelectMethod="GetWClient" /></ClientBindingSettings> </ISWebCombo:WebCombo>
My webservice code:
<WebMethod> _ Public Function GetWClient(ByVal selectArguments As ISNet.ClientServices.DataSourceSelectArguments) As QueryResult Try Dim context As dcWanTechDataContext = New dcWanTechDataContext Dim query As WebComboDataProvider(Of tbFil_Client) = New WebComboDataProvider(Of tbFil_Client)(context.tbFil_Client)
Return query.Select(selectArguments) Catch ex As Exception MsgBox(ex.Message)
End Try End Function
OK thanks, I found that the FilterExpression value has been changed from "[Name]" to "[0]", That the error come from. I just replace the [0] to [Name] and it's working fine.
Glad that you have found your problem. If you have any further question, please don't hesitate to ask us.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname