Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3672784
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:39:06+00:00 2026-05-19T02:39:06+00:00

Next SubSonic3 query gives me an error: Db.Update<Tag>() .SetExpression(Popularity) .EqualTo(Popularity+1) .Where<Tag>(x => x.TagId ==

  • 0

Next SubSonic3 query gives me an error:

Db.Update<Tag>()
    .SetExpression("Popularity")
    .EqualTo("Popularity+1")
    .Where<Tag>(x => x.TagId == tagId)
    .Execute();

Error: failed: System.FormatException : Failed to convert parameter value from a String to a Int32.

The sql that is generated is ok, but the collection of parameters contains two parameters that need to be set.

UPDATE [Tagging].[Tag] 
SET Popularity=Popularity+1
WHERE [Tagging].[Tag].[TagId] = @0

One of the parameters set @up_Popularity to ‘Popularity+1’. Since this is the first parameter being set, sql triese to assign this string ‘Popularity+1’ to an integer.

Is this a bug or am I doing something wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:39:07+00:00Added an answer on May 19, 2026 at 2:39 am
    Db.Update<Tag>()
        .SetExpression("Popularity = Popularity + 1")
        .Where<Tag>(x => x.TagId == tagId)
        .Execute();
    

    This should work … but I think it’s for wholesale updates. Not sure. Your best bet is to use our CodingHorror:

    new CodingHorror("UPDATE Tags SET Popularity = Popularity + 1 WHERE @1", 
      tagId).Execute();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Next query runs successfully: select top(100) * from PackageSessionNodes where Cast(ContentInteractions as nvarchar) !=
next_permutation is a C++ function which gives the lexicographically next permutation of a string.
The next two declarations are equivalent: protected type prot_Type is .... pragma Priority(System.Priority'Last); end;
Next term, I'll need to write a basic operating system for Motorola 68K processor
Next code gives me 5.999999999999998 in Result, but right answer is 6. Alpha =
Why next code gives me stack around variable x was corrupted ? char x[1][21];
next code doesnt work because of spaces in file names, How to fix? IFS
My next project is going to be using Windows Communication Foundation to host Managed
The next code runs normally in SQLSERVER but when i change the web.config to
The next method of java.util.Random , when I view source in Eclipse, is essentially:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.