in

System.Data.SQLite

An open-source, enhanced version of the SQLite database engine for Windows

Connection String Problem

Last post 03-05-2008 11:22 AM by bd_epa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-05-2008 9:50 AM

    • bd_epa
    • Top 500 Contributor
    • Joined on 03-05-2008
    • Posts 4

    Connection String Problem

    I am trying to create a new SQLiteConnection which connects to a database on a network drive. Here is some sample code:

    scn = new SQLiteConnection("Data Source ='" + databasePath + "'");
    scn.Open();

     The databasePath is L:\Priv\developer\virtualbeach\csc_data\beachmanager.db.  When I call the Open method, I get a NotSupportedException.  The exception message is 'The given path's format is not supported.'

     Is anyone else having this problem?  The database connects just fine if I specify the database without the drive letter.

    Thanks in advance for advice / help.

     -Ben

    Filed under:
  • 03-05-2008 11:22 AM In reply to

    • bd_epa
    • Top 500 Contributor
    • Joined on 03-05-2008
    • Posts 4

    Re: Connection String Problem

    Fixed my own problem.  Changed the connection string from (Data Source='" + databasePath + "'") to (data source=" + databasePath +";")

     Note that I removed the single quotes surrounding the databasePath.  I thought those were necessary if the path contained spaces, but they are not.  The case of the word 'Data Source' may have been important. Got bigger fish to fry than to test it.  Will stick with all lowercase in the future.

    Hope this helps others in the future.

     -Ben

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems