I have a solution, thanks to Alex Smith. This works:
sqliteCmd.CommandText = "INSERT INTO "
System.Data.SQLite.SQLiteTransaction sqliteTran =
sqliteConnection.BeginTransaction();
sqliteCmd.ExecuteNonQuery();
long lKeyID = sqliteConnection.LastInsertRowId;
sqliteTran.C
On Tue, Feb 7, 2017 at 4:11 PM, Clyde Eisenbeis wrote:
> int iKeyID = (int)sqliteCmd.ExecuteScalar();
>
I believe the type of last_insert_rowid() is *always* INT64
--
--
--
--Ö¿Ö--
K e V i N
___
sqlite-users mailing list
sqli
Clyde Eisenbeis wrote:
>
> using (System.Data.SQLite.SQLiteConnection sqliteConnection = new
> System.Data.SQLite.SQLiteConnection("Data Source=" + stPathFilename +
> ";")) {
> using (System.Data.SQLite.SQLiteCommand sqliteCmd =
> sqliteConnection.CreateCommand()) {
> ...
> sqliteC
that your statement inserts exactly one
>> record and that nothing is executed on your connection between the insert
>> and the call.
>> >
>> > -Ursprüngliche Nachricht-----
>> > Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org
e-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org]
> Im Auftrag von Chris Locke
> > Gesendet: Freitag, 03. Februar 2017 15:41
> > An: SQLite mailing list
> > Betreff: Re: [sqlite] Retrieve INTEGER PRIMARY KEY
> >
> > Last_insert_rowid()
> >
> >
I'm writing WPF / C# code. This is part of a function that is called
whenever the user enters data that is saved. The primary key is used
whenever the user changes that record ... to ensure the correct data
is changed.
On Mon, Feb 6, 2017 at 10:11 AM, Simon Slavin wrote:
>
> On 6 Feb 2017, at 1
On 6 Feb 2017, at 1:30pm, Clyde Eisenbeis wrote:
> What is the correct nomenclature for using last_insert_rowid() for
> SQLite? For OLE DB I've used ... oledbCmd.CommandText = "Select
> @@Identity" ... int iKeyID = (int)oledbCmd.ExecuteScalar().
last_insert_row() is an SQL variable. In whatev
What is the correct nomenclature for using last_insert_rowid() for
SQLite? For OLE DB I've used ... oledbCmd.CommandText = "Select
@@Identity" ... int iKeyID = (int)oledbCmd.ExecuteScalar().
On Mon, Feb 6, 2017 at 7:24 AM, Clemens Ladisch wrote:
> Clyde Eisenbeis wrote:
>> Perhaps there is no eq
There is no record locking in SQLite
-Ursprüngliche Nachricht-
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im
Auftrag von Clyde Eisenbeis
Gesendet: Montag, 06. Februar 2017 14:19
An: SQLite mailing list
Betreff: Re: [sqlite] Retrieve INTEGER PRIMARY KEY
In
Clyde Eisenbeis wrote:
> Perhaps there is no equivalence to OLE DB ... oledbCmd.CommandText =
> "Select @@Identity" ... int iKeyID = (int)oledbCmd.ExecuteScalar()?
This has *nothing* to do with OLE DB; @@Identity is an SQL Server
specific thing. SQLite's is last_insert_rowid(), and both have
exac
and the
> call.
>
> -Ursprüngliche Nachricht-
> Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im
> Auftrag von Chris Locke
> Gesendet: Freitag, 03. Februar 2017 15:41
> An: SQLite mailing list
> Betreff: Re: [sqlite] Retrieve INTEGER PRIMA
> Le 5 févr. 2017 à 18:26, Clyde Eisenbeis a écrit :
>
> To clarify further, the SQLite function is attached.
Attachments to this mailing list are stripped.
Better inline in the email itself if short or send privately to the recipient.
:)
--
Best Regards, Meilleures salutations, Met vriendeli
To clarify further, the SQLite function is attached. Retrieving the
primary key is commented (used by System.Data.OleDb function).
On Sun, Feb 5, 2017 at 10:40 AM, J Decker wrote:
> http://data.sqlite.org/c3ref/last_insert_rowid.html
>
> there is an api call to get it; or you can use select and
Gesendet: Freitag, 03. Februar 2017 15:41
An: SQLite mailing list
Betreff: Re: [sqlite] Retrieve INTEGER PRIMARY KEY
Last_insert_rowid()
https://www.sqlite.org/c3ref/last_insert_rowid.html
On Fri, Feb 3, 2017 at 1:51 PM, Clyde Eisenbeis wrote:
> For OLE DB SQL, I have retrieved the primary
http://data.sqlite.org/c3ref/last_insert_rowid.html
there is an api call to get it; or you can use select and get it
the .net library has it as a connection property LastInsertRowId
https://www.crestron.com/reference/simpl_sharp/html/P_Crestron_SimplSharp_SQLite_SQLiteConnection_LastInsertR
On 5 Feb 2017, at 1:26pm, Clyde Eisenbeis wrote:
> The compiler complains about "SELECT last_insert_rowid()" ... which
> appears to be limited to SQLite3.
The compiler should never have got that string. The string is executed when
the program is already compiled, just like any other SELECT co
The compiler complains about "SELECT last_insert_rowid()" ... which
appears to be limited to SQLite3. Perhaps I'm missing something?
On Sat, Feb 4, 2017 at 10:28 AM, Wolfgang Enzinger wrote:
> Am Sat, 4 Feb 2017 09:04:58 -0600 schrieb Clyde Eisenbeis:
>
>> When I enter last_insert_rowid(), the c
Am Sat, 4 Feb 2017 09:04:58 -0600 schrieb Clyde Eisenbeis:
> When I enter last_insert_rowid(), the compiler complains. I think
> last_insert_rowid() is SQLite3.
>
> Is there an equivalent for System.Data.SQLite?
I don't know, but you can use the SQL function of the same name:
https://www.sqlite
When I enter last_insert_rowid(), the compiler complains. I think
last_insert_rowid() is SQLite3.
Is there an equivalent for System.Data.SQLite?
On Fri, Feb 3, 2017 at 8:40 AM, Chris Locke wrote:
> Last_insert_rowid()
>
> https://www.sqlite.org/c3ref/last_insert_rowid.html
>
> On Fri, Feb 3,
Last_insert_rowid()
https://www.sqlite.org/c3ref/last_insert_rowid.html
On Fri, Feb 3, 2017 at 1:51 PM, Clyde Eisenbeis wrote:
> For OLE DB SQL, I have retrieved the primary key:
>
> -
> using (System.Data.OleDb.OleDbConnection oledbConnect = new
> System.Data.OleD
For OLE DB SQL, I have retrieved the primary key:
-
using (System.Data.OleDb.OleDbConnection oledbConnect = new
System.Data.OleDb.OleDbConnection(stConnectString))
{
using (System.Data.OleDb.OleDbCommand oledbCmd =
oledbConnect.CreateCommand())
{
...
21 matches
Mail list logo