views:

241

answers:

1

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.

+3  A: 

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.

Jon Skeet
Its working, but I had to go to SourceForge to get a copy, and ultimately had to run its setup... I guess if its all a go, we can find out what specifically needs to be deployed. Thanks
DRapp