string query = "Create table " + name +
" (Manpower_Name NVARCHAR(50), Instance INT, Start NVARCHAR(30), End NVARCHAR(30));";
我在 C# 中为 SQL Server CE 数据库(一个.sdf
文件)制作了这个连接字符串。但是我收到一个错误,如下所示:
解析查询时出错。[令牌行号=1,令牌行偏移量=77,错误令牌=结束]
从函数执行:
public void create_proj_table(string name)
{
string query = "Create table " + name + " (Manpower_Name NVARCHAR(50), Instance INT, Start NVARCHAR(30), End NVARCHAR(30));";
//open connection
if (this.OpenConnection() == true)
{
//create command and assign the query and connection from the constructor
SqlCeCommand cmd = new SqlCeCommand(query, connection);
//Execute command
cmd.ExecuteNonQuery();
//close connection
this.CloseConnection();
}
}