freebsd-ports/misc/cdcollect/files/patch-src_DBsql.cs
Pawel Pekala 0b1558fe45 - Add LICENSE information
- Switch to USES=localbase
- Port is architecture neutral
- Regenerate patch with make makepatch
2016-08-13 20:16:08 +00:00

16 lines
569 B
C#

--- src/DBsql.cs.orig 2006-11-24 17:12:13 UTC
+++ src/DBsql.cs
@@ -958,10 +958,10 @@ public class CDDatabaseSql
private int sql_command_id (string comm)
{
IDbCommand command = sqlite_connection.CreateCommand ();
- command.CommandText = comm;
- command.ExecuteScalar ();
+ command.CommandText = comm + "; SELECT last_insert_rowid() AS [ID]";
+ string s = command.ExecuteScalar ().ToString ();
command.Dispose ();
- return (((SqliteConnection)sqlite_connection).LastInsertRowId);
+ return Int32.Parse (s);
}
private void sql_command (string comm)