' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Imports System
Imports System.Data
Imports System.Data.SqlServerCe

Namespace E
    Public Class TestClass
        Public Shared Sub Main(args As String())
            Dim con As New SqlCeConnection("Data Source=TestEmb.sdf; Password=hemmeligt")
            con.Open()
            Dim sel As New SqlCeCommand("SELECT * FROM tbl", con)
            Dim rdr As SqlCeDataReader = sel.ExecuteReader()
            While rdr.Read()
                Console.WriteLine(CInt(rdr(0)) & " " & DirectCast(rdr(1), String))
            End While
            rdr.Close()
            con.Close()
        End Sub
    End Class
End Namespace
