(VS 2005) SQL Compact Connection
I would be most grateful if anybody could help with sql server 2005 compact edition connection string and also when I use imports system.data.sqlserverce I get errors. I am new to mobile developing so I need help badly. Below is what I am trying to do but to no avail.
Code:
Imports System.Data
Imports System.Data.sqlServerCe
Public Class ShiftManagerDB
Public Shared Function GetConnected() As SqlServerCe
Return New SqlServerCe(GetConnectionString)
End Function
Public Shared Function GetConnectionString() As String
GetConnectionString = "Data source=my documents\ShiftManagerPro.sdf;persist security info=False;"
End Function
End Class
The SqlServerCe is always underline as error.
I am using this class in a windows app that I am coding for mobile.
Re: (VS 2005) SQL Compact Connection
Have you added a reference to sqlserverce?
Try "Data Source=\My Documents\ShiftManagerPro.sdf" for your connection string
Pete
Re: (VS 2005) SQL Compact Connection
Quote:
Originally Posted by petevick
Have you added a reference to sqlserverce?
Try "Data Source=\My Documents\ShiftManagerPro.sdf" for your connection string
Pete
Thanks Pete, but I am getting error with the imoprts system. Normaly when you type imports and hit space you get system and when click on dot you get Data and when click on dot you get sqlclient in windows but here I was expecting to get sqlserverce after Imports system.Data, so that the declaration will read Imports system.Data.SqlServerCe. Any Help
Re: (VS 2005) SQL Compact Connection
You will need to 1st add a reference to SqlServerCe to the project. So Right Click on reference and select Add, then pick SqlServerCe reference form the list.
this will make it available in the imports system.data.sqlserverce
Resolve (VS 2005) SQL Compact Connection
Quote:
Originally Posted by Strider
You will need to 1st add a reference to SqlServerCe to the project. So Right Click on reference and select Add, then pick SqlServerCe reference form the list.
this will make it available in the imports system.data.sqlserverce
Thanks All