Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Database
Database General Discussion
Adding single quotes to dataset fields ready for input to table
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="bloukewer, post: 2915, member: 384"] [b]HERE's SOME CODE[/b] You can use this piece of code I wrote for an application of mine. I placed the function in a module so that I were able to call it up whenever I wrote to my database. Feel welcome to copy and paste it. It works 100%. '****************************************************** Friend Function ParseToSql(ByVal InputString As String) As String Dim strtemp As String strtemp = "" Dim cnt As Integer For cnt = 0 To InputString.Length - 1 If InputString.Substring(cnt, 1).Equals("'") Then strtemp &= "''" ElseIf InputString.Substring(cnt, 1).Equals("""") Then strtemp &= """" 'MessageBox.Show(cnt & " replaced. New string = " & strtemp) Else strtemp &= InputString.Substring(cnt, 1) End If Next Return strtemp End Function '********************************************** Please note... It might look like double quotes, but it's not. It's double single quotes inside single double quotes :D ENJOY! [/QUOTE]
Insert quotes…
Verification
Post reply
Database
Database General Discussion
Adding single quotes to dataset fields ready for input to table
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom