On Mon, 07 Apr 2008 05:08:46 +0200, Gilles Ganault
<[EMAIL PROTECTED]> wrote:
>Would someone have a step-by-step procedure on how to get from a
>working VisualStudio 2005 to a working SQLite access?

For those interested, http://sqlite.phxsoftware.com seems to work in
VS2005 Pro:

====
Imports System.Data.SQLite
Imports System.Data

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click

        Dim SQLconnect As New SQLite.SQLiteConnection()
        Dim SQLcommand As SQLiteCommand
        Dim Output As String

        Try
            SQLconnect.ConnectionString = "Data
Source=c:\test.sqlite;"
            SQLconnect.Open()

            SQLcommand = SQLconnect.CreateCommand
            SQLcommand.CommandText = "CREATE TABLE IF NOT EXISTS dummy
(name TEXT)"
            SQLcommand.ExecuteNonQuery()

            SQLcommand.CommandText = "INSERT INTO dummy VALUES ('" &
TextBox1.Text & "')"
            SQLcommand.ExecuteNonQuery()

            SQLcommand.CommandText = "SELECT * FROM dummy"
            Dim SQLreader As SQLiteDataReader =
SQLcommand.ExecuteReader()
            SQLcommand.Dispose()

            Output = ""
            While SQLreader.Read()
                Output &= String.Format("Name = {0}", SQLreader(0)) &
vbCrLf
            End While
            MessageBox.Show(Output)

        Catch
            MessageBox.Show("Failed")

        Finally
            SQLconnect.Close()
            TextBox1.Clear()
            Button1.Enabled = False
        End Try
    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        Button1.Enabled = True
    End Sub
End Class
====

HTH,

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to