Newbie SQlCe Connection question

  • Thread starter Thread starter Bob Clegg
  • Start date Start date
B

Bob Clegg

Hi,
My First CE App.
SQL CE Version 2.0
Emulator accepted Database creation line and I've added a table using the
Query analyser in the emulator.
But my connection string refuses to connect.
Database was created in the My Computer root directory of the emulator.
Code is :
System.Data.SqlServerCe.SqlCeConnection cn = new
System.Data.SqlServerCe.SqlCeConnection("Data Source= MyDatabase.sdf");

The error generated is a SystemException but the message property of the
exception is an empty string.

I have tried ("Data Source=\\My Computer\\ MyDatabase.sdf");

Same Result.

Thanks

Bob
 
Needs to be an explicit path to the database
System.Data.SqlServerCe.SqlCeConnection cn = new
System.Data.SqlServerCe.SqlCeConnection("Data Source= \\MyDatabase.sdf");
 
Hi Alex.
Thanks for that.
regards
Bob
Alex Feinman said:
Needs to be an explicit path to the database
System.Data.SqlServerCe.SqlCeConnection cn = new
System.Data.SqlServerCe.SqlCeConnection("Data Source= \\MyDatabase.sdf");
 
Back
Top