robertohuertasm / SQLite4Unity3d

SQLite made easy for Unity3d
MIT License
1.28k stars 265 forks source link

How I update a specific item #46

Closed dareyko closed 7 years ago

dareyko commented 8 years ago

Hi So I have a table name "situacion" and have this columns

public int situacionID { get; set; }
    public string historia { get; set; }
    public string emocion { get; set; }
    public bool tarjeta { get; set; }``

I want to update "tarjeta" from false to true using "situacionID" as the reference, something like this: UPDATE situacion SET tarjeta = true WHERE situacionID = 6;

I make this in the DataServise archive, but I dont know how to put the condition to "situacionID"

public situacion update_tarjeta(){
        var p = new situacion{
            tarjeta = true,
        };
        _connection.Update (p);
        return p;

English it not my first language so I hope you understadn my crappy english.

robertohuertasm commented 8 years ago

dareyko I'd suggest you to use the documentation from this Github repo. You can use normal sql syntax. You're not forced to use linq.