您的位置:首页 > 博客中心 > 数据库 >

ASP.NET web 程序中使用Sqlite嵌入式数据库(相对路径)

时间:2022-03-13 22:38

string sqliteFilePath = Server.MapPath("~/App_Data/SQLite数据库名"); //这个文件是预先生成的数据库文件
SQLiteConnection conn = new SQLiteConnection("Data Source=" + sqliteFilePath);//声明一个SQLite数据库的链接         
conn.Open();//打开数据库

  当然,在这之前要先添加引用 System.Data.SQLite.dll(网上一搜,大把!)

ASP.NET web 程序中使用Sqlite嵌入式数据库(相对路径),布布扣,bubuko.com

热门排行

今日推荐

热门手游