Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when User Agent contains apostrophes #2

Closed
clupasq opened this issue Sep 8, 2016 · 1 comment
Closed

Error when User Agent contains apostrophes #2

clupasq opened this issue Sep 8, 2016 · 1 comment

Comments

@clupasq
Copy link

clupasq commented Sep 8, 2016

When a User Agent contains an apostrophe ('), the Udger client fails with the exception:

System.Data.SQLite.SQLiteException (0x80004005): SQL logic error or missing database
unrecognized token: ":"
DataReader.cs(62,0): at Udger.Parser.DataReader.selectQuery(String query)
UdgerParser.cs(106,0): at Udger.Parser.UdgerParser.parseUA(String _userAgent)
UdgerParser.cs(73,0): at Udger.Parser.UdgerParser.parse()
Program.cs(46,0): at ConsoleTest.Program.Main(String[] args)

This is because query parameters are being added to the sql query by concatenation.
SqliteParameters should be used instead. Here are some of the reasons why: http://stackoverflow.com/a/20017707/390819

@mallat
Copy link
Contributor

mallat commented Sep 10, 2016

Fixed

@mallat mallat closed this as completed Sep 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants