sqlite3内存数据库可以多次连接吗?
我先创建了一个守护进程,然后打开一个sqlite3的内存数据库。请问接下来如何连接、读写这个内存数据库?
dim DbFullName as string = "c:\userdb.db" Dim qstr1 As String = "SELECT c3 ,c5 , c2 ,c4 ,c1 FROM tab1;" dim DbConn As SQLiteConnection Dim ConnStrBuilder As New SQLiteConnectionStringBuilder With { .DataSource = DbFullName} DbConn = New SQLiteConnection With {.ConnectionString = ConnStrBuilder.ConnectionString} Try DbConn.Open() '连接 Dadapter = New SQLiteDataAdapter(qstr1, DbConn) Dadapter.Fill(Dset, "tab1") '读取 ' 如果要更新,把Dadapter.UpdateCommand改为Update ... 语句.(表最好设置主键) 再: 'Dadapter.Update(Dset.Tables("tab1")) Me.DGVLocalDb1.DataSource = Nothing Me.DGVLocalDb1.DataSource = Dset.Tables("tab1") Me.ToolStripStatusLabel1.Text = "提示:读入配置文件...成功。" Catch ex As Exception MsgBox(ex.Message) End Try