创建SQL Server CE数据库文件编程数据库文件、SQL、Server、CE

2023-09-02 21:10:22 作者:几人难应

如何创建一个新的SQL Server Compact数据库文件(。自卫队)编程,而无需现有的模板文件的复制?

How can I create a new SQL Server Compact database file (.sdf) programmatically, without having an existing template file to copy from?

推荐答案

这里有一些好消息:的用C#创建SQL Server Compact Edition数据库

There is some good info here: Create a SQL Server Compact Edition Database with C#

string connectionString = "DataSource="test.sdf"; Password="mypassword"";
SqlCeEngine en = new SqlCeEngine(connectionString);
en.CreateDatabase();