Connection String - SQL Server 3.5 Compact?

ultraFritz

New member
Joined
Nov 9, 2009
Messages
3
Programming Experience
Beginner
Hello!

This is a extrem VB.newbie question.
I try to connect to my SQL Compact 2008 Server 3.5 Database like that:

VB.NET:
Imports System.Data.SqlClient

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'open database connection
        Dim myConnection As SqlConnection = New SqlConnection()
        myConnection.ConnectionString = "Data Source=C:\Documents and Settings\myName\My Documents\Visual Studio 2008\Projects\Language-Dictionary\Language-Dictionary\Database1.sdf;Persist Security Info=False;"
        
myConnection.Open()

        MsgBox("A Connection to the Database is now open")

        'close the connection
        myConnection.Close()
        MsgBox("The Connection to the Database is now Closed")
    End Sub


----
I'm not using a password.
Is the pattern of the connection string correct or do I miss something?


Thanks!
 

ultraFritz

New member
Joined
Nov 9, 2009
Messages
3
Programming Experience
Beginner
I still couldn't find the solution for the Compact version - but I changed now to the big brother SQL 2008. This is working now.
 
Last edited:
Top Bottom