In my project I use System.Data.SQLite. Database has table Tags, which contains autoincrement primary field ID (type Integer). When I write:
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();
}
Visual Studio said that the operation is not supported. How to fix it?
UPDATE
Error occurs on line:
command.Parameters.Add("@id", DbType.Int32).Direction = ParameterDirection.Output;
UPDATE #2
Working code:
SELECT last_insert_rowid()