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

  • Home
  • SEARCH
  • 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 448983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:43:27+00:00 2026-05-12T21:43:27+00:00

I have recently been tasked with upgrading an application from .net 1.1 to 3.5

  • 0

I have recently been tasked with upgrading an application from .net 1.1 to 3.5 and came across a RowFilter on a DataView that had a different behavior between the two versions.

Here is my code block in 1.1 that works in 1.1 but not 3.5. I get the following error trying to run this in 3.5 “Cannot perform ‘=’ operation on System.String and System.Int32”
Both the 1.1 and 3.5 are hitting the same database, I am just confused as to how 1.1 sees the string parameter and treats it as a string without having to put tic marks around it but in 3.5 it sees rptNum and requires you to put tics around it. The field in the dv is a string DataType.

    private DataView BuildDataView(string rptNum) {
        DataView dv = null;

        if(dt != null) {
            dv=new DataView(dt);
            dv.RowFilter="reporting_number = " + rptNum;
        }

        return dv;
    }

Here is my code block in 3.5 changed so that it works. I had to add tic marks around the string parameter so that it would treat it as a string.

    private DataView BuildDataView(string rptNum) {
        DataView dv = null;

        if(dt != null) {
            dv=new DataView(dt);
            dv.RowFilter="reporting_number = '" + rptNum + "'";
        }

        return dv;
    }
  • 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-12T21:43:27+00:00Added an answer on May 12, 2026 at 9:43 pm

    Given the error message:

    "Cannot perform '=' operation on System.String and System.Int32
    

    it sounds as though the value of rptNum causing the error is numerical (although the column of String type): just a guess, but maybe version 1.1 looks first at the value of the variable in the filter and is forgiving enough to process it if the filter clause can be interpreted as given by the user, whereas in 3.5 the type cast takes precedence. Do you get the an error message if rptNum is non-numerical when run in version 1.1 of your code?

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

Sidebar

Related Questions

I have recently been doing a bit of investigation into the different types of
I have recently been put in charge of debugging two different programs which will
I have recently been working with someone on a project that is very ajax
We have an application that performs auto-updates. Until recently, we haven't run into any
I am running a J2EE web application in Tomcat, and recently I have been
I have recently been tasked with finding a suitable installShield replacement and I am
I have been tasked with going through a number of ColdFusion sites that have
I've recently been tasked with improving a records database that consists of the following:
Have recently been given a project to complete which uses XML quite extensively.Am looking
I have recently been thinking about the difference between the two ways of defining

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.