I am wanting to use [red]SQL Compact Edn database[/red] for a single user application being written in Visual Studio 2008. I can programatically create the Database as such:
However, I cannot find [red]code[/red] that shows [red]how to create tables programatically[/red] nor how to [red]query the Compact SQL Edn Database programatically[/red]. Can anyone point me in the right direction on how to do this. (I can create the tables and query via SS Management Studio but need to do it programatically) using visual basic in visual studio 2008.
regards
kieran777
Code:
Private Sub CreateDatabase()
Protected Const SQLDBfullfilename = "C:\Users\KGM\Documents\Visual Studio 2008\Projects\myDB_2008\RPMSDAL\myDB_2008.sdf"
Protected Const SqlConnectionString As String = _
"Data Source='" & SQLDBfullfilename & "'; LCID=1033;Password='sa'; Encrypt = TRUE"
Dim engine = New SqlCeEngine
engine.LocalConnectionString = NEWDBconnectionString
Try
engine.CreateDatabase()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly, "Create Compact Database v3.5 failed.")
End Try
engine.Dispose()
End Sub
However, I cannot find [red]code[/red] that shows [red]how to create tables programatically[/red] nor how to [red]query the Compact SQL Edn Database programatically[/red]. Can anyone point me in the right direction on how to do this. (I can create the tables and query via SS Management Studio but need to do it programatically) using visual basic in visual studio 2008.
regards
kieran777