110,568
社区成员
发帖
与我相关
我的任务
分享
string CurrentPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
string SQLDB = CurrentPath + "\\MyMVSDB.db";
//添加数据库数据源
if (!System.IO.File.Exists(SQLDB))
{
MessageBox.Show(CurrentPath);
MessageBox.Show("无法找到相应的数据库");
}
SQLDB = "Data Source=" + SQLDB + ""; //给sqlite的连接字符串赋值
SQLiteConnection conn = new SQLiteConnection(SQLDB);
conn.Open();