Unable to select data from excel when it contains 's in cell

Hi

I am not able to execute select query when i get data with 'S.
Please find the screen shot below:

vendor_Name is coming as : POP’S PTE. LTD and it is comapring with excel which looks somethig like below screenshot

image

Can you please guide me how i can write the select query for it. Find my select query in above screenshot .

Regards,
Ahtesham

Try Escaping the single quotes with double quotes. Like below.

outDt_Vendor_Reference_Table.Select(string.Format(“[Full Vendor Name] =‘{0}’”,vendor_Name.Replace(“'”,“‘’”)));

Thank you

I am still facing error , can you please have a look where I am doing wrong .
I have attached XAML and corresponding excel file.

sample.xlsx (8.2 KB)
SingleQuotesSample.xaml (11.4 KB)

Regards,
Ahtesham

PFA, with modified select query.
SingleQuotesSample.xaml (11.9 KB)

1 Like

Thank you , it worked

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.