database - How do I connect to SQLite db file from c#? -
I am trying to connect to sqllite db with a C # application I have never worked with SQLLite before is.
var connectionString = @ "data source = 'c: \ testdata \ StressData.s3db'"; Connection = new SQLiteConnection (connectionString); Connection.Open ();
When I try to open the connection the following exception:
System.NotSupportedException: The format of the given path is not supported.
on System.Security.Util.StringExpressionSet.CreateListFromExpressions System.Security.Util.StringExpressionSet.CanonicalizePath (String Path, Boolean NeedFullPath) (String [] str, Boolean NeedFullPath) Am I Incorrect tax
thanks ..
nick
update:
I change the 'data source' as a 'data source' Suggested to me Now I get a new error:
After changing it, I get a new error: System.ArgumentException: Data source can not be empty. Usage: Memory: To open a memory database in System.Data.SQLite.SQLiteConnection.Open ()
Any more suggestions
found.
"data source = c: \ TestData \ StressData.s3db, version = 3", "
< / Pre>It seems that the 'version' attribute is not optional Interesting that the .NET provider does not show it in the Designer property window.
Comments
Post a Comment