andrewharris
asked on
Programatically create SQL Server CE 2000 database in C#
Hello,
Can anyone point me to a way to programatically create a SQL Server CE 2000 database (.sdf file) using C#.
Cheers
Andrew
Can anyone point me to a way to programatically create a SQL Server CE 2000 database (.sdf file) using C#.
Cheers
Andrew
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
aneeshattingal my friend... you are a star! That worked a treat, just had to change C:\ to a valid Pocket PC path, ie \\Program Files\\TestApp\\, etc
And just to add for anyone else who looks for this, to password protect the database:
SqlCeEngine engine = new SqlCeEngine("Data Source='\\Program Files\\TestApp\\test.sdf'; Password='password'");
engine.CreateDatabase();
Cheers
Andrew
And just to add for anyone else who looks for this, to password protect the database:
SqlCeEngine engine = new SqlCeEngine("Data Source='\\Program Files\\TestApp\\test.sdf';
engine.CreateDatabase();
Cheers
Andrew
Ok.. Now you can close the Question ...
http://samples.gotdotnet.com/quickstart/CompactFramework/doc/sqlcedbcreate.aspx