Sunday, July 20, 2008

connect VB .NET to SQLite

1. create new project, save all, and exit VS

2. Copy sqlite/bin folder to YourProject/bin

3. Run bin/Designer/install.exe , check the box, close

3. Open up the project again.

4. To add a custom provider to your application's config file (app.config).

click project > add new item > general tab > application configuration file

Add the following code to your app.config file:


<configuration>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite"/>
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
</DbProviderFactories>
</system.data>
</configuration>


5. Add new data source

click Data > Add new data Source > select Database > next > click New Connection > Select SQLite Database File > uncheck "Always use this selection" > click Continue

6. click "New" > select the path to store the database file > next

No comments: