Sqlite is getting my headache in my C # 2.0 windows application

Since this morning I have been struggling with this sqlite issue. After reading good tutorials, I decided to use it as an embedded database in my winform application. I downloaded SQLite-1.0.61.0-setup which installed system.datal.sqlite for me and downloaded the firefox plugin plugin manager and another wxSQLitePlus management tool found here based on these guides found here (just being explicit) Hope I am not posting which -or stupid things to be ignored, here are my 2 problems. the first problem is that I cannot reference the database inside the let'say database folder I have an exception "Cannot open database file" .my app.config looks like this

<connectionStrings>
  <add name="embcon" connectionString="Data Source=database\iagency.db;Version=3;"/>

      

but if iagency.db is inside root folder there is no problem on all.app.config like

<connectionStrings>
  <add name="embcon" connectionString="Data Source=iagency.db;Version=3;"/>

      

the second chalenge is an object created with tools like firefox plugin or wxsqlite + cannot be queried inside visual studio 2005 which I am using. If it is requested in a table, I have an item that does not exist, although both tools display the same data. and the inverse table created by queries inside visual studio cannot be viewed by tools. so what's the deal? is this memory stuff, or am I just missing some points? can enybody explain what's going on? Thanks for reading.

0


a source to share


2 answers


Try using the full path to the file as your data source (eg Data Source = c: \ data \ iagency.db)



See this post for details: Data source location in connection string

+1


a source


Try the following:



<add name="embcon" connectionString="Data Source=|DataDirectory|\iagency.db;Version=3;"/>

      

0


a source







All Articles