How Do I find the string has an apostrophe, single quote in the string.
I have a function
Public Function ReplaceSingleQuote(ByRef val As String)
'//***This function replaces the single quote to double quote***\\
If IsNothing(val) = False OrElse val <> String.Empty Then
val = val.Replace("'", "''")
val = val.TrimStart
But, the problem here is that if use for multiple times for the same string it inserts too many single quotes.
Is there any way it just detects an single apostrophe and then replaces it with '' for sql compatibility.