我需要列添加到表,现在我有这样的代码:这个sqllite alter table查询有什么问题?
public void InsertParameter(string ColumnName)
{
string sql = "ALTER TABLE table_name ADD :value1";
SQLiteCommand cmd = new SQLiteCommand(sql,conn);
cmd.Parameters.AddWithValue("value1", ColumnName);
cmd.ExecuteNonQuery();
}
但是,这给我的语法错误:
near ":value1":syntax error
我实在想不出有什么不对本查询?
[插入新列到表中源码?(可能的重复http://stackoverflow.com/questions/4253804/insert-new-column- into-table-in-sqlite) –
不是重复的,而是更多的后续问题。 – dan04