mercredi 4 mars 2015

Xamarin.Android SQLiteException when inserting into the database

i keep getting this error when trying to insert into my sqlite db.Other insertions work well,but it doesn't seem to go beyond this point.Has anyone encountered this error?how do you solve it?


Below is the code and the Application output that shows the error.



public long SaveReceiverPoints(string closeDate,string createDate,string createWho,string easting,string elevation,
string fileKey ,string isDeployed,string isManual,string lastModifyDate,string latitude,string line ,string longitude,
string centralReceiverPointKey,string receiverType,string station,string receiverPointUserProfile)
{
double lat = 1.2607;
double lon = 36.804;
var dbconn = new SQLiteConnection(dbHandler.WritableDatabase.Path) ;
using(dbconn){

return dbconn.Insert (new ReceiverPointTable {



LATITUDE = lat,
LONGITUDE = lon,

});
}


The output is as follows:



[ImportDataActivity] SQLite.SQLiteException: Constraint
[ImportDataActivity] at SQLite.PreparedSqlLiteInsertCommand.ExecuteNonQuery (System.Object[] source) [0x00000] in <filename unknown>:0
[ImportDataActivity] at SQLite.SQLiteConnection.Insert (System.Object obj, System.String extra, System.Type objType) [0x00000] in <filename unknown>:0

Aucun commentaire:

Enregistrer un commentaire