Business Issue Filter Issue

Author Message
 Posted 6/5/2014 8:15:06 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 11/9/2020 7:12:23 AM
Posts: 41, Visits: 347

Hello,

When I have to filter BO, this code works fine until First Name has a single quote (For example o'reilly)

CustomerBO.Filter = "FirstName = '" & First_Name & "'"


What is the alternative?



Tags:
Post #32615
Add to Twitter Add to Facebook
 Posted 6/5/2014 10:07:17 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 11/9/2020 7:12:23 AM
Posts: 41, Visits: 347
I found the answer:

First_Name.Trim.Replace("'""''")
replace single quote with two single quote.

Post #32616
Add to Twitter Add to Facebook
 Posted 6/5/2014 4:12:12 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 11/24/2020 3:02:15 PM
Posts: 2,436, Visits: 24,150
Hi Danny,

Use the String.Format instead to set your filter condition, it is cleaner and work all the time.

CustomerBO.Filter = String.Format("First_Name = {0}", First_Name)


Edhy Rijo
(Using VB.Net 2019/SQL Server 2017)


Edited: 6/5/2014 4:13:47 PM by Edhy Rijo
Post #32617
Add to Twitter Add to Facebook
 Posted 6/7/2014 7:36:50 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 11/9/2020 7:12:23 AM
Posts: 41, Visits: 347
Thank you.
Post #32618
Add to Twitter Add to Facebook


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.