问题
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?
回答1:
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"
来源:https://stackoverflow.com/questions/22263206/quickbooks-api-v3-filters-quotation