I'm trying to use SQLite to make databases in visual c# 2010 but when I select "SQLite Database File" I don't get the opportunity to point to a database file. I get a dialog that asks me for a connection string. I have not been able to come up with a connection string that doesn't give me the error "Could not load file or assembly 'Microsoft.VisualStudio.Data, version=9.0.0.0, PublicKeyToken=...'The located assembly's manifest definition does not match the assemble reference."
I've learned that this is due to the data tools for Visual Studio were not successfully installing, but I've开发者_如何学运维 tried uninstalls and reinstalls to no avail. The only relevant thread I could find was at http://www.basarat.com/2010/05/sqlite-for-visual-studio-2010.html
I used the latest SQLite-1.0.66.0-setup. Does anyone have any thoughts?
May or may not solve your problem. Here's from my blog post on my own experience with getting the latest SQLite up and going in Visual Studio 2010 a few days ago:
The current binary installers from sqllite.org for the System.Data.SQLite .NET assembly do not include the Visual Studio designers or the ADO.NET driver required for use of SQLite in the Server Explorer. So here’s the winning combination I’ve found for getting my environment set up properly.
1.Download and install version 1.0.66.0 from sourceforge.net because current binary installs on SQLite.org at system.data.sqlite.org do not include the Visual Studio designer or ADO.NET driver install.
2.Download and install the latest versions (x86 and x64) from system.data.sqlite.org (currently 1.0.73.0 which contains the SQLite 3.7.6.3 engine). Important Note: If you have Visual Studio 2008 and 2010, be sure to choose both when prompted as I found reports from others who had problems otherwise.
3.Copy the x86 binaries into and overwriting file at C:\Program Files (x86)\SQLite.NET\bin (assuming you used the default install location for version 1.0.66.0 and you're running x64 Windows). And if you are on an x64 box, copy the x64 binaries to the C:\Program Files (x86)\SQLite.NET\bin\x64 directory, overwriting existing files.
Try add these lines
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Data" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
to the file C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\.config
Then restart Visual Studio.
See this sqlite forum article. The connection string basically includes the filename and some options. Eg:
"Data Source=mydb.db;Version=3;New=True;"
This would use mydb.db as your sqlite database and use the version 3.0 runtime library (best) and would create a New db file if it did not exist.
Download SQLite binaries , extract zip, navigate to "bin/Designer" folder and run install.exe. Maybe this will help.
精彩评论