I did not want to talk about anything. I just researched it and found it ~~~ Post Code:
/// <Summary> Insert
/// Returns the inserted ID.
/// </Summary>
/// <Param name = "groupname"> </param>
/// <Param name = "gid"> </param>
/// <Returns> </returns>
Public Bool Insert ( String Groupname, Out String GID)
{
String SQL = " Insert into groupca (groupname) values (@ groupname); select last_insert_rowid (); " ;
Helper. createcommand (SQL );
Helper. addparameter ( " @ Groupname " , Groupname As Object );
String Res = Helper. executescalar ();
If ( ! String . Isnullorempty (RES ))
{
GID = Res;
Return True ;
}
Else
{
GID = " 0 " ;
Return False ;
}
}
The aboveCodeI used the operation class of an SQLite database I created earlier. Of course, the most important one is the statement. In fact, select last_insert_rowid (); It is equivalent to select @ identity in MSSQL;