Im trying to use SQLite iwith c#, the autoincreement attribute for a field in primary key seems not working properly :-\
the code is
//Globals
SQLiteClient db;
//.....creating table
db.Execute("CREATE TABLE tblProva (id INT AUTOINCREMENT ,name VARCHAR( 255 ) NOT NULL ,PRIMARY KEY ( id ) ) ");
//.....inserting row
db.Execute("INSERT INTO tblProva (nome) VALUES (ciao)");
//..then the select
SQLiteResultSet results;
results = db.Execute("SELECT * FROM tblProva ");
foreach (ArrayList arr in results.Rows)
{
foreach(object j in arr)
Console.Write("\t" + Convert.ToString(j) );
Console.WriteLine();
}
//but it doesnt insert an autoincrement INT into id field!! , theres undefined value instead... can u help me?
the code is
//Globals
SQLiteClient db;
//.....creating table
db.Execute("CREATE TABLE tblProva (id INT AUTOINCREMENT ,name VARCHAR( 255 ) NOT NULL ,PRIMARY KEY ( id ) ) ");
//.....inserting row
db.Execute("INSERT INTO tblProva (nome) VALUES (ciao)");
//..then the select
SQLiteResultSet results;
results = db.Execute("SELECT * FROM tblProva ");
foreach (ArrayList arr in results.Rows)
{
foreach(object j in arr)
Console.Write("\t" + Convert.ToString(j) );
Console.WriteLine();
}
//but it doesnt insert an autoincrement INT into id field!! , theres undefined value instead... can u help me?