Posted on: 7/11/2014 12:55:14 AM | Views : 411

Hi,
I have the following code in an ASP.NET code-behind:
string strDaysID = objDaysID.ToString();  //  this is actually an int passed in DataTable dt = HelperClass.GetDataTable("dtDays", "spGetCenterDays"); DataRow[] rows = dt.Select("CenterDaysID = '" + strDaysID + "'");
It works fine when run from within Visual Studio 2012.  However, when deployed to a server, it gives the following error:
System.Data.EvaluateException: Cannot perform '=' operation on System.Int32 and System.String.
If I modify the code to not include the single quotes, it still runs fine in VS, but on the server I now get the error:
Missing operand after the '=' operator.
Any idea what is going on here?
 
Thanks.
--Dan
 

Go to the complete details ...