views:

34

answers:

2

Hi ,

I recently converted my SQL Server database into SQLite db . But when I try to open my SQLite using .Open() it throw me this error

Data Source cannot be empty.  Use :memory: to open an in-memory database

Edit: added connection string:

ConnectionString = @"Data Source= D:\XXX.db;Version=3;
connection = new SQLiteConnection(connectionString); 
connection.Open();

Why do i get this . I converted the same SQL Server database to SQL CE and mySQL I didnt get these error .. Any help appriciated .

A: 

Because your Data Source is empty. Add the Data Source paramater to your connection string. before opening the Sqlite database.

jojaba
Its not empty .I had specified exact path dude.. connectionString = @"Data Source= D:\XXX.db;Version=3; connection = new SQLiteConnection(connectionString);connection.Open();
ITion
Perhaps removing the space from the front of the `D:\` and close the connectionString with a double quote might help.
jojaba
sorry guys its my mistake .. at one place i have mentioned as"datasource" without spaces ..that caused the problem. Thanks
ITion
A: 

You haven't provided a data source name, aka where the sqlite file exists.

Yann Ramin
I did ,refer my other comments
ITion