|
-
May 25th, 2007, 07:54 PM
#1
Thread Starter
Hyperactive Member
(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.
Last edited by wiadus; May 25th, 2007 at 07:57 PM.
-
May 26th, 2007, 01:30 AM
#2
Frenzied Member
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
-
May 26th, 2007, 02:57 AM
#3
Thread Starter
Hyperactive Member
Re: (VS 2005) SQL Compact Connection
 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
-
May 26th, 2007, 06:58 AM
#4
Fanatic Member
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
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
May 26th, 2007, 07:45 AM
#5
Thread Starter
Hyperactive Member
Resolve (VS 2005) SQL Compact Connection
 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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|