我正在尝试使用c#应用程序连接到sqllite数据库。我之前从未使用过SQLLite。
var connectionString = @"data source='C:\TestData\StressData.s3db'";
connection = new SQLiteConnection(connectionString);
connection.Open();
当我尝试打开连接时,我得到以下异常:
System.NotSupportedException: The given path's format is not supported.
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
我究竟做错了什么?
谢谢..
缺口
更新:
我按照建议将“数据源”更改为“DataSource”。现在我收到一个新错误:
更改此内容后,我收到一个新错误:System.ArgumentException:Data Source不能为空。使用:memory:在System.Data.SQLite.SQLiteConnection.Open()中打开内存数据库
还有什么建议吗?