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 757571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:22:44+00:00 2026-05-14T15:22:44+00:00

this is my code ProductController.cs public ActionResult Details(string id) { product productx = productDB.products.Single(pr

  • 0

this is my code

ProductController.cs

public ActionResult Details(string id)
{
    product productx = productDB.products.Single(pr => pr.Product1 == id);
    return View(productx);


}

Details.aspx

    <td>
        <%-- : Html.ActionLink("Edit", "Edit", new { id=item.Id }) % --> 
        <%: Html.ActionLink("Details", "Details", new { id = item.Product1 })%>
    </td>

this is what im using to list some products from a sql database, each product have a link to a Details page to show more informations about it

what Im trying is to only put the product label in that link to let it show something like http://www.mysite.com\products\battery (not the id)

I’ve imagined this should work, but it throw an The data types text and nvarchar are incompatible in the equal to operator. error and
neither (pr => pr.Product1.Equals(id)); works

the error is clear and Im asking how should I do to make it work this way ?

thanks

  • 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-14T15:22:44+00:00Added an answer on May 14, 2026 at 3:22 pm

    TEXT columns in SQL Server are considered Large Object data and therefore aren’t indexable/searchable. They’re also deprecated. So, actually, the problem is in your database, not in your application.

    If you change the column type to a varchar(max), you can store the same amount of character data but shouldn’t have this problem. Then, update your Linq to SQL entity, and you’ll no longer get this particular error.

    Having said that… a column named ID shouldn’t be TEXT or varchar(max), it should be an auto-increment integer ID or a GUID (uniqueidentifier), so you might want to revisit your DB design. But assuming you have good reasons for IDs to be string values of arbitrary size, the above change will allow you to filter on the column.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is this code wrong? It's just not returning anything: public IEnumerable<string> GetMethodsOfReturnType(Type cls, Type
This code does not compile. public class Diamond { public static void diamondOfAsterisks(String *
I have this call: List<Product> featProducts = productsRepository.Products.Where(x => x.Featured == true).ToList(); It returns
This code separates a string into tokens and stores them in an array of
This code: <% string path = Request.ApplicationPath.ToString(); %> <link href=<%= path %>/Content/Site.css rel=stylesheet type=text/css
This code doesn't work: return this.Context.StockTakeFacts.Select(stf => ((stf.StockTakeId == stocktakeid) && (stf.FactKindId == ((int)kind)))).ToList<IStockTakeFact>();
This code in JS gives me a popup saying i think null is a
This code is from Prototype.js . I've looked at probably 20 different tutorials, and
this code always returns 0 in PHP 5.2.5 for microseconds: <?php $dt = new
This code works (C# 3) double d; if(d == (double)(int)d) ...; Is there a

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.