在项目开发中充分体会到了一个精简数据存储模块的重要性及实用性;在综合了三年开发经验的基础上,向各位推介一下sqlite数据库,希望更多的程序猿支持开源精神。
Imports System.data.SQLite
Public Class Form1
Dim conn As SQLiteConnection
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If System.IO.File.Exists("test.db3") = True Then
System.IO.File.Delete("test.db3")
End If
SQLiteConnection.CreateFile("test.db3")
conn = New SQLiteConnection("Data Source=test.db3;Pooling=true;FailIfMissing=false")
If conn.State <> ConnectionState.Open Then
conn.Open()
MsgBox("打开成功!")
End If
Dim cmd As New SQLiteCommand
cmd.Connection = conn
cmd.CommandText = &#