black sensei
black sensei

Reputation: 6678

sqlite is given me headache in my C#2.0 windows application

I'm struggling since this morning about this sqlite thing.after reading some good tutorials i decided to use it as my embedded database in my winform application. i downloaded SQLite-1.0.61.0-setup that install the system.datal.sqlite for me and downloaded the firefox plugin sqlite manager and another management tool called wxSQLitePlus found here based on this tutorials found here (just being explicit) Hoping i'm not posting any stupid stuff that will be ignored, here are my 2 challenges. the first challenge is that i can't reference the database inside a folder let'say database i have exception "Unable to open the database file".my app.config is as follow

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

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

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

the second chalenge is that object created via tools such as either firefox plugin or wxsqlite+ cannot be queried inside visual studio 2005 that i'm using.if it's a table when queried , i have an excetion the object doesn't exist even though both tools displays the same data. and inversly table created by queries inside visual studio cannot be viewed by the tools. so what's the deal? is it a memory stuff or i'm just missing some points? can enybody explain what is happening ?Thanks for reading.

Upvotes: 0

Views: 380

Answers (2)

Thomas Levesque
Thomas Levesque

Reputation: 292405

Try that :

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

Upvotes: 0

Kevin Pullin
Kevin Pullin

Reputation: 13327

Try using the full filepath as the data source (e.g. Data Source=c:\data\iagency.db)

See this post for more: datasource location in connection string

Upvotes: 1

Related Questions