Error In Like Operator The String Pattern
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies
Error In Like Operator The String Pattern Is Invalid C#
of this site About Us Learn more about Stack Overflow the company Business error in like operator the string pattern ' 0-9 ' is invalid Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up issues with finding data with certain strings up vote 1 down vote favorite 1 I am trying to make this work but have been unlucky it is giving me th following error Error in Like operator: the string pattern '%testing : | / - “ ‘ & * # @%' is invalid. This search works as long as it doesnt contain a string as the one above.. This is my code for the search DataRow[] rows = GetAllItems.Select("Name like '%" + cleanedText + "%'"); I tried - Modified per cHaos (still errors though) string cleanedText = SearchText.Replace("\"", "\\\"").Replace("'", "''"); but no luck when i enter the following string in the search although i know it is in the data testing : | / - “ ‘ & * # @% Anyone has a nice suggestion Thank you c# asp.net escaping share|improve this question edited Oct 13 '11 at 19:57 asked Oct 13 '11 at 19:32 user710502 4,4291970134 Are you using a SQL database? –Oded♦ Oct 13 '11 at 19:34 Ummm... what does this do? sSearctText.Replace("\"", "\"")? –Mark Byers Oct 13 '11 at 19:34 1 You do realize that .Replace("\"", "\"") does nothing useful, right? Same with all the other backslashed replacements -- you're replacing wacky chars with the exact same char. You probably want .Replace("\"", "\\\"") and the like. –cHao Oct 13 '11 at 19:35 sSearchText is the original variable - cHao, i used that Replace("\"", "\"") and i
0 verified answers | 4 Replies | 2 Followers ocornuau Points 990 Replied On: Thu, Oct 6 2011 8:59 AM Reply Hello,I have a webcombo Suggest That is type-ahead and bound to a DataTable (. Net). The problem Is That if I enter values of the format "'qqqq * k", an exception "Error in Like operator: the string pattern' qqqq * k% 'is invalid"Why?Is there a workaround?I tried with the event client "EditKeyDown" but I can not remove the characters "%" and "*".cordially Reply Post Points: 20 All Replies http://stackoverflow.com/questions/7759468/issues-with-finding-data-with-certain-strings [Infragistics] Nikifor Tsvetkov Points 13,438 Replied On: Fri, Oct 7 2011 9:03 AM Reply Suggested by [Infragistics] Nikifor Tsvetkov Hello Cornuau,Please take a look at the attached sample created with latest service release 11.1.20111.2064. Sample was tested with IE 9 and Firefox 7 and did not provided the misbehavior you faced. Please feel free to modify the sample or created http://www.infragistics.com/community/forums/t/60671.aspx a new one which reproduces the issue. Sincerely, Nikifor Developer Support Engineer Infragistics, Inc. www.infragistics.com/support 74313_WC.zip Reply Post Points: 20 ocornuau Points 990 Replied On: Mon, Oct 10 2011 5:11 AM Reply Hello,I use version 11.1.20111.2020. The WebCombo is associated with an object "asp: ObjectDataSource" owned "SelectMethod" uses a method that returns a DataSet.cordially Reply Post Points: 35 [Infragistics] Nikifor Tsvetkov Points 13,438 Replied On: Tue, Oct 11 2011 8:53 AM Reply Suggested by [Infragistics] Nikifor Tsvetkov Hello Cornuau,Can you please modify the attached sample to reproduce your code. The reason for the issue could be due to the way ObjectDataSource is configured with functions for Update, Sort, Insert etc. Does this issue reproduce with all the browsers? I will have to reproduce the same behavior on my side and debug to see if the error is in our controls or wrong implementation from your side. I also recommend always updating to the latest service release.Looking forward to hearing from you. Sincerely, Nikifor Developer Support Engineer Infragistics, Inc. www.infragistics.com/support Reply Post Points: 5 [Infragistics] Nikifor Tsvetkov Points 13,438
SERVICES Services Overview Education Services Business Critical Services Consulting Services Managed Services Appliance Services CUSTOMER CENTER Customer Center Support Community MyVeritas Customer Success Licensing Programs Licensing Process ABOUT About Corporate Profile Corporate Leadership Newsroom Research Exchange Investor Relations Careers Legal https://www.veritas.com/support/en_US/article.000012787 Contact Us English 中文(简体) English Français Deutsch Italiano 日本語 한국어 Português Español USA Site: Veritas Veritas PartnerNet Error in Like operator: the string pattern 'John Doe [Acct Dept]' is invalid Article:000012787 Publish: Article URL:http://www.veritas.com/docs/000012787 http://www.tek-tips.com/viewthread.cfm?qid=1113463 Support / Article Sign In Remember me Forgot Password? Don't have a Veritas Account? Create a Veritas Account now! Welcome First Last Your Profile Logout Sign in to Subscribe Please sign in to error in set up your subscription. Close Sign In Print Article Products Article Languages Subscribe to this Article Manage your Subscriptions Problem Attempting to add a Role assignment to a new Active Directory user fails with "Error in Like operator: the string pattern 'John Doe [Acct Dept]' is invalid" when the new user has [square brackets] in their display name. Error Message Error in Like operator: the string pattern error in like 'John Doe [Acct Dept]' is invalid Solution Applying the Role a second time will be successful. Symantec Corporation has acknowledged that the above-mentioned issue is present in the version(s) of the product(s) referenced in this article. There are currently no plans to address this issue by way of a cumulative hotfix or service pack in the current or previous versions of the software at the present time. This issue may be resolved in a future major revision of the software at a later time, but is not scheduled for any release. If you feel this issue has a direct business impact for you and your continued use of the product, please contact your Symantec Sales representative or the Symantec Sales group to discuss these concerns. For information on how to contact Symantec Sales, please see http://www.symantec.com. Terms of use for this information are found in Legal Notices.
Related Articles Article Languages x Translated Content Please note that this document is a translation from English, and may have been machine-translated. It is possible that updates have been made to the original version after this document was translated and published. Veritas does not guarantee the accuracy regarding the completeness oJoin INTELLIGENT WORK FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! Are you aComputer / IT professional?Join Tek-Tips Forums! Talk With Other Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free! Join Us! *Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden.Tek-Tips Posting Policies Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.Just copy and paste the BBCode HTML Markdown MediaWiki reStructuredText code below into your site. C# (C sharp): Microsoft Forum at Tek-Tips HomeForumsProgrammersLanguagesC# (C sharp): Microsoft Forum Error using LIKE Operator 2 thread732-1113463 Forum Search FAQs Links MVPs Error using LIKE Operator Error using LIKE Operator FurqanAhmed (Programmer) (OP) 25 Aug 05 10:34 Hi,I'm working on a text box control on windows form. The text box helps the user in inputing hotel names. As the user inputs each letter of the hotel name,the text box provides the remaining name that matches the user provided input. For example, if the user input "HIL", the text box displays "HILTON". Recently I've received couple of complain from users when they input this hotel name "4 * SELECT-RAD HOTEL". The specific error that is given is "Error in Like operator: the string pattern '4 * %' is invalid.". What I've figured out so far is whenever the '%' operation is used after '*', an error is generated. The C# code is----------------------------------DataView dv;dv = new DataView(this.hotelTable, "Name LIKE '"+txtHotelName.Text+"%'", "Name", DataViewRowState.CurrentRows);if(dv.Count > 0){int txtCount = txtHotelName.Text.Length;string hotelName = dv[0]["Name"].ToString();this.lsbErrors.Items.Add(""