简体   繁体   中英

C# and parameterized SQLite, WITHOUT going through ADO.NET

Is it possible, and if so, how... To do parameterized queries with SQLite WITHOUT having to go through ADO.NET. I've been asked to do some testing with SQLite for a project that needs to have a zero-admin install... ie: no special permissions, things added to windows registry, etc. I would suspect that using an ADO.NET would require such, even though SQLite is just a DLL sitting in the project directory.

And yes, I do understand the importance of parameterized queries and issues that can arise out of SQL-Injection if not handled safely.

What makes you think that ADO.NET would require registry entries etc? It doesn't. You just need .NET installed and the appropriate provider assembly.

Now, you won't need all of ADO.NET - for instance, you may well not need the DataTable / DataSet support, if you're happy to use the appropriate DataReader type yourself - but again, if you do want to use them (even strongly typed versions) you shouldn't need any special settings.

Of course, it's possible that the SQLite provider has its own requirements around the registry, but I very much doubt it. That would go against my "normal" ADO.NET provider experience, as well as being against the normal usage of SQLite.

I expect there are various SQLite providers. For instance, there's one here which combines the .NET part and the native code of SQLite itself, so there's just the single DLL to deploy alongside your application, as far as I can tell. It doesn't get much simpler than that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM