string query = "Create table " + name +
" (Manpower_Name NVARCHAR(50), Instance INT, Start NVARCHAR(30), End NVARCHAR(30));";
SQL Server CE データベース (.sdf
ファイル) 用に C# でこの接続文字列を作成します。しかし、次のようにエラーが発生します。
クエリの解析中にエラーが発生しました。[トークン ライン番号 = 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();
}
}