【发布时间】:2009-07-23 14:15:03
【问题描述】:
我使用此代码,SQLite 说“数据源不能为空。使用 :memory: 打开内存数据库”
这是我的代码
string dbfile = new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).DirectoryName + "\\m23.db";
string sql;
DateTime dt = DateTime.Now;
SQLiteConnection connection = new SQLiteConnection("datasource="+ dbfile);
SQLiteDataAdapter adapter = new SQLiteDataAdapter("select * from p_posts", connection);
DataSet data = new DataSet();
adapter.Fill(data); // <<< here i get the error
SQLiteCommand cmd = new SQLiteCommand();
cmd.CommandType = CommandType.TableDirect;
cmd.Connection = connection;
connection.Open();
感谢任何帮助, 干杯!
【问题讨论】: