string datasource = "d:\\test.db"; //数据库文件的地址
System.Data.SQLite.SQLiteConnection.CreateFile(datasource); //产生文件
这样产生出的test.db就可以在asp.net中运用了,此时你即使用SqliteAdmin以及SQLite Expert Professional 2软件打开它在里面建表都不影响它的使用了。
对Sqlite的操作其实跟Access非常像的,只不过OleDB开头的都变成了SQLite而已…
.NET Framework Data Provider for ODBC
DRIVER=SQLite3 ODBC Driver; Database=mydb.db; LongNames=0; Timeout=1000; NoTXN=0;SyncPragma=NORMAL; StepAPI=0;
This is just one connection string sample for the wrapping OdbcConnection class that calls the underlying ODBC Driver. See respective ODBC driver for more connection strings to use with this class.
SQLite3 ODBC Driver
DRIVER=SQLite3 ODBC Driver; Database=mydb.db; LongNames=0; Timeout=1000; NoTXN=0;SyncPragma=NORMAL; StepAPI=0;
SQLite.NET
Basic(基本的) Data Source=filename;Version=3; Using UTF16(使用UTF16编码) Data Source=filename;Version=3;UseUTF16Encoding=True; With password(带密码的) Data Source=filename;Version=3;Password=myPassword; Using the pre 3.3x database format(使用3.3x前数据库格式) Data Source=filename;Version=3;Legacy Format=True; Read only connection(只读连接) Data Source=filename;Version=3;Read Only=True; With connection pooling(设置连接池) Data Source=filename;Version=3;Pooling=False;Max Pool Size=100; Using DateTime.Ticks as datetime format() Data Source=filename;Version=3;DateTimeFormat=Ticks;Copyright © 2019- fenyunshixun.cn 版权所有 湘ICP备2023022495号-9
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务