Question

Updating through EntitySchemaQuery

Hi,

Can we able to update or create records using EntitySchemaQuery??

Now I am using Update class to set "UsrRupeevalue" with result a float type



        Update update = new Update(UserConnection, "Contact")

            .Set("UsrRupeevalue", result)

            .Where("Name").IsEqual(Column.Parameter(id));

            Update update = new Update(UserConnection, "Contact")

            .Set("UsrRupeevalue", result)

            .Where("Name").IsEqual(Column.Parameter(id));

I am getting below error in visual studio

Error    CS1503    Argument 2: cannot convert from 'decimal' to 'Terrasoft.Core.DB.Select'

How can I acheive this?

 

Like 0

Like

1 comments

Please modify your query in the following way:

1) use Column.Parameter(result) instead of "result"

2) change Update update = new Update(UserConnection, "Contact")...     to

var update = new Update(UserConnection, "Contact")...

There is an example below:

var x = 2.4;

Guid ObjectId = new Guid("c4ed336c-3e9b-40fe-8b82-5632476472b4");

var update = new Update(UserConnection, "Contact")

          .Set("UsrMoney", Column.Parameter(x))

          .Where("Id").IsEqual(Column.Parameter(ObjectId));

update.Execute(); 

            

Show all comments