Subsonic 3.0.0.4 Does not Update

Posted by geocine on Stack Overflow See other posts from Stack Overflow or by geocine
Published on 2010-04-12T23:44:13Z Indexed on 2010/04/18 9:43 UTC
Read the original article Hit count: 580

I tried 3 variants but doesn't seem to update (I am using Linq Templates and MSSQL)

    Luna.Data.GameDBDB db = new Luna.Data.GameDBDB(); 
    db.Update<Luna.Record.TB_ITEM>()
        .Set(x => x.ITEM_DURABILITY == Convert.ToInt32(quantity))
        .Where(x => x.ITEM_DBIDX == Convert.ToInt32(dbdidx))
        .Execute();

Here is the other one

var db = new Luna.Data.GameDBDB();
var query = (from p in db.TB_ITEMS where p.ITEM_DBIDX == Convert.ToInt32(dbidx) select p).Single();
query.ITEM_DURABILITY = Convert.ToInt32(quantity);
db.tp TP_ITEM_UPDATE();

and the other one

var db = new Luna.Data.GameDBDB();
var query = (from p in db.TB_ITEMS where p.ITEM_DBIDX == Convert.ToInt32(dbidx) select p).Single();
query.ITEM_DURABILITY = Convert.ToInt32(quantity);
db.Update<Luna.Data.TB_ITEM>();

However it worked using LINQ-to-SQL

            LunaDataContext db = new LunaDataContext();
            var query = (from p in db.TB_ITEMs
                         where p.ITEM_DBIDX == Convert.ToInt32(dbidx)
                         select p).Single();
            query.ITEM_DURABILITY = Convert.ToInt32(quantity);
            db.SubmitChanges();

Is this a bug in 3.0.0.4, the database record couldn't be updated using Linq Templates and ActiveRecord.

© Stack Overflow or respective owner

Related posts about subsonic3

Related posts about subsonic-active-record