1

I am a newbie in regards to System.Data.SQLite and .NET, so bear with me. I can't seem to get System.Data.SQLite even installed correctly. The self-installer completed and everything seemed to be kosher, but nothing seems to be working. In VC# Express, I tried to create a little sample program(http://pastebin.com/m8f7cec), but it's saying that it can't find System.Data.SQLite at the line: using System.Data.SQLite;. Also the Database explorer always errors out when I try to make a new connection, starting with, "Could not load file or assembly Microsoft.VisualStudio.Data"... I also don't know what to put in the Connection string. Can someone help just get this started? I am familiar with SQLite itself.
Thanks,
deftonix

3 Answers 3

4

All the installer does is put the proper libraries on your local machine, as well as enable the plug-ins within Visual Studio to allow you to explore your databases via Server Explorer.

You still need to Right Click on your "References" section in your project and add a reference to the library in order for it to work at runtime.

Sign up to request clarification or add additional context in comments.

2 Comments

Well, I feel dumb, that worked perfectly for accessing the DB through code. However, the VC# database explorer still doesn't work correctly. I am getting the same cryptic error message no matter what Connection String I use.
Are you setting the connection string in your app.config file? The location often changes between development and runtime, and the best bet is to update the connection string there. I saw your screenshot, but it looks to be occurring when creating a new data connection. Do you get the same error when running the app?
3

You need to add a reference within your project to the System.Data.SQLite dll.

For the connection string, try http://www.connectionstrings.com, it has the format for most common connections.

3 Comments

Isn't the reference using System.Data.SQLite; ? Or am I missing something? Thanks.
See Dillie-O's comment, you need to actually add a reference to the dll within the project. There should be a references folder, right click on that, select 'Add references..' then navigate to where the auto-extractor put the dll (or better yet set up a lib folder within your project and copy the dll there). 'Using' only specifies that that particular class can use the dll, not the project in general.
Yes, that worked, however, the VC# database explorer still doesn't work correctly. I am getting the same cryptic error message no matter what Connection String I use. See here -> tinypic.com/r/rcsl5g/6
0

This is now available through NuGet (the question was asked 8 years ago when I'm guessing it was not in NuGet).

Add it with NuGet and that will download the DLL(s) and add it as a reference.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.