how to creat a database with password in sqlce

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In following code,how to create a database with password

SqlCeReplication rep=new SqlCeReplication(
@"http://GRWEBSERVER/virdir/sscesa20.dll",
"username","password",
"GRWEBSERVER",
"SCDATA_PDA",
"SCDATA_PDA_PUBLICATION",
"kasj1",
@"Data Source=\My Documents\aaa.sdf" );
try
{
if(!System.IO .File.Exists (@"\My Documents\aaa.sdf"))
{
rep.AddSubscription (AddOption.CreateDatabase );
}
rep.Synchronize() ;
MessageBox.Show("successful");
}
catch(SqlCeException ex)
{
DisplaySQLCEErrors(ex);
}
finally
{
rep.Dispose();
}

thx anyway
 
Jacky,

After the SQL CE database is created following the merge
replication, you need to use the Compact method on the engine
object to specify a password and/or encryption. See the SQL CE
Books OnLine for examples of the Compact method.
--
Darren Shaffer
..NET Compact Framework MVP
Principal Architect
Connected Innovation
www.connectedinnovation.com
 
Back
Top