dub*_*tor 6 c# sqlite auto-increment
在我的项目中,我使用System.Data.SQLite.数据库有表Tags,其中包含自动增量主要字段ID(类型Integer).我写的时候:
using (SQLiteCommand command = conn.CreateCommand())
{
command.CommandText = "insert into Tags(name) values(@name) returning into @id";
command.Parameters.Add("@id", DbType.Int32).Direction = ParameterDirection.Output;
command.ExecuteNonQuery();
}
Run Code Online (Sandbox Code Playgroud)
Visual Studio表示不支持该操作.怎么解决?
在线发生错误:
command.Parameters.Add("@id", DbType.Int32).Direction = ParameterDirection.Output;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9417 次 |
| 最近记录: |