private string strConn = "Data Source = \\test.sdf";
private void button1_Click(object sender, EventArgs e)
{
SqlCeEngine dbEngine = new SqlCeEngine();
dbEngine.LocalConnectionString = strConn;
try
{
dbEngine.CreateDatabase();
}
catch( SqlCeException ex)
{
MessageBox.Show("unable to creat db at "+ dbEngine.LocalConnectionString +" . Reason "+ex.Errors[0].Message);
}
}
报错是:unable to creat db at data source=\test.sdf;.Reason SQL Server CE encountered problems in creating the SQL Server Ce database.[,,,Connection string,,]