Hi all I'm trying to perform a transaction where there are two updates on the same table and one insert to another table. Here is the code that I've written :
List<SubSonic.SqlQuery> coll = new List<SubSonic.SqlQuery>();
coll.Add(new SubSonic.Update(WestsideBank.CustomerAccount.Schema).Set(WestsideBank.CustomerAccount.BalanceColumn).EqualTo(ChangedDesBalance).Where(WestsideBank.CustomerAccount.AccountIDColumn).IsEqualTo(desacid));
coll.Add(new SubSonic.Update(WestsideBank.CustomerAccount.Schema).Set(WestsideBank.CustomerAccount.BalanceColumn).EqualTo(ChangedSrcBalance).Where(WestsideBank.CustomerAccount.AccountIDColumn).IsEqualTo(srcacid));
coll.Add(new SubSonic.Insert().Into(WestsideBank.Transaction.Schema).Values("newid()", srcacid, amttrans, "getdate()", desacid, ChangedSrcBalance));
SubSonic.SqlQuery.ExecuteTransaction(coll);
Now this code is giving me an error saying that
1.Error 1 The best overloaded method match for 'System.Collections.Generic.List<SubSonic.SqlQuery>.Add(SubSonic.SqlQuery)' has some invalid arguments C:\Inetpub\wwwroot\WestsideBank\Customers\Transfers.aspx.cs 41
2.Error 2 Argument '1': cannot convert from 'SubSonic.Insert' to 'SubSonic.SqlQuery' C:\Inetpub\wwwroot\WestsideBank\Customers\Transfers.aspx.cs 41
Now I think that my choice of "type class" here is wrong but what should I use to support both insert and update? Or is there any other better way of doing it.
Also I used sql "newid()" and "getdate()" inside the insert statement. Is it the right way to do it or is there any subsonic special function which does this for me. And also should I use quotes for variables that I use inside the "insert()" parameter. Please help.