Dim myConnection As SqlCeConnection
Dim dt As New DataTable
Dim Adapter As SqlCeDataAdapter
'myConnection = New SqlCeConnection("Data Source =" + (System.IO.Path.GetDirectoryName( System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase ) + "\Database1.sdf;"))
myConnection = New SqlCeConnection("Data Source=C:\WindowsFormsApplication\WindowsFormsApplication\Database1.sdf;")
myConnection.Open()
Dim myCommand As SqlCeCommand = myConnection.CreateCommand()
myCommand.CommandText = "SELECT [id], [name], [email] FROM [mytable]"
myCommand.CommandType = CommandType.Text
Adapter = New SqlCeDataAdapter(myCommand)
Adapter.Fill(dt)