Tuesday, July 22, 2008

SQLite 速記2


Dim sqlBugs As New SQLite.SQLiteConnection()
Dim dsBugs As New DataSet()
Dim daBugs As New SQLiteDataAdapter()
Dim cmdBugs As New SQLiteCommandBuilder()
Dim theDataGridView As New DataGridView()

sqlBugs = New SQLite.SQLiteConnection("Data Source=C:\vb08sbs\DannySQL\DannySQL\Data\aaa.db3;")
dsBugs = New DataSet("dataset1")

daBugs = New SQLiteDataAdapter("SELECT * FROM [foo]", sqlBugs)
cmdBugs = New SQLiteCommandBuilder

If sqlBugs.State <> ConnectionState.Open Then sqlBugs.Open()

cmdBugs.DataAdapter = daBugs

'daBugs.Fill(dsBugs)
daBugs.Fill(dsBugs)

'theDataGridView.DataSource = dsBugs.Tables(0).DefaultView

No comments: