StrataFrame Forum
Back
Login
Login
Home
»
.NET Forums
»
General .NET Discussion
»
VB syntax - quotes in string
VB syntax - quotes in string
Post Reply
Like
0
Prev
1
2
Jump To Page
VB syntax - quotes in string
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Charles R Hankey
Charles R Hankey
posted 16 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 524,
Visits: 30K
FWIW - the square brackets
don't
work
Reply
Like
0
Charles R Hankey
Charles R Hankey
posted 16 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 524,
Visits: 30K
Thanks, Eddy
Yes I like that syntax better.
But once again, the guid is surrounded by single quotes. Are single quotes valid in VB .net or is that just something made possible by Microfour in setting the filter. I realize that in code actually sent in a sql server query the single quote would be appropriate but I was surprised to find it working in within the BO. ( now I need to test it with square brackets ... )
No complaints, of course, as there is a lot to like about some of the tricks we learned in Fox.
Reply
Like
0
Edhy Rijo
E
Edhy Rijo
posted 16 Years Ago
ANSWER
Post Details
Share Post
E
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
Charles R Hankey (02/19/2009)
...And what other ways are there to do this that work?
How about this one:
Dim
filtstr
As
String
=
String
.Format(
"cclientkey = '{0}'"
,
Me
.cKey)
Edhy Rijo
Reply
Like
0
Charles R Hankey
Charles R Hankey
posted 16 Years Ago
ANSWER
HOT
Topic Details
Share Topic
Group: Forum Members
Posts: 524,
Visits: 30K
I am using guid keys.
In a custom data source BO for a report I am putting a filter on a child cursor
Basically I want the filter to be "cclientkey =" and then the guid as a string - but of course in quotes
_policydisplay.SourceBO.Filter = "cclientkey = " & Me.ckey.ToString
doesn't work as the guid is not surrounded by quote in the resulting filter string.
I googled and tried things like
Dim quotes As Char = ChrW(34)
Dim filtstr As String = "cclientkey = " & quotes & Me.ckey.ToString & quotes
_policyDisplay.SourceBO.Filter = filtstr
Dim filtstr As String = "cclientkey = """ & Me.ckey.ToString & """"
_policyDisplay.SourceBO.Filter = filtstr
etc and no joy
Then reverted to the old Foxpro way
Dim filtstr as String = "cclientkey = '" & me.ckey.toString & "'" ( using single quotes to surround the guid )
and it works.
But a single quote to surround a string will throw and error. Is this some magic the old Foxers at Microfour have made possible? Never saw any solution like this in VB land? And what other ways are there to do this that work?
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
0
Prev
1
2
Jump To Page
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search