Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
495 views
in Technique[技术] by (71.8m points)

vb.net - Quickbooks api v3 filters quotation

I have an item with name='9" Plate - Champagne' in quickbooks online. but if I use method that I use its doesn't return anything and that's happens only with item name with quotation mark.

Dim ItemQueryService As New Intuit.Ipp.QueryFilter.QueryService(Of Intuit.Ipp.Data.Item)(context)
Dim q As String = "Select * from Item where Name = '9" Plate - Champagne'"
Dim Itemlist = ItemQueryService.ExecuteIdsQuery(q)

How to handle special quotation in this statement?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The escape for the double quote is another double quote, so try:

Dim q As String = "Select * from Item where Name = '9"" Plate - Champagne'"

Edit: Hrmm..

Did you try:

Dim q As String = "Select * from Item where Name = '9" Plate - Champagne'"

or

Dim q As String = "Select * from Item where Name = '9"" Plate - Champagne'"

or

Dim q As String = "Select * from Item where Name = '9"""" Plate - Champagne'"

or

Dim q As String = "Select * from Item where Name = '9" Plate - Champagne'"

or

Dim q As String = "Select * from Item where Name = '9%22 Plate - Champagne'"

Actually.. have you tried url-encoding the whole string?

Dim q As String = "Select%20*%20from%20Item%20where%20Name%20%3D%20%279%22%20Plate%20-%20Champagne%27"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...