Asp.net中使用Sqlite数据库的方法
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
The default value is ISO8601 which activates the use of the ISO8601 datetime format
如果把Guid作为文本存储需要更多的存储空间
Data Source=filename;Version=3;Cache Size=2000;
Cache Size 单位是字节
Page Size 单位是字节
Data Source=filename;Version=3;FailIfMissing=True;
默认情况下,如果数据库文件不存在,会自动创建一个新的,使用这个参数,将不会创建,而是抛出异常信息
Disable the Journal File (禁用日志回滚)
This one disables the rollback journal entirely.
This one blanks and leaves the journal file on disk after a commit. Default behaviour is to delete the Journal File after each commit.
相关文章
完美兼容ie和firefox的asp.net网站加入收藏和设置主页
这篇文章主要介绍了完美兼容ie和firefox的asp.net网站加入收藏和设置主页,需要的朋友可以参考下2014-12-12
asp.net treeview checkbox 相关问题
asp.net treeview checkbox 相关问题,需要的朋友可以看下。2009-06-06


最新评论