I have a VERY simple query that is failing after I upgraded from 6.80.350.0 to 220.127.116.11.
All I am doing is a simplet select on a primary key:
var qry = from a in db.EXEMPTIONs
where a.EXEMPTION_SEQ == lExemptionSeq
When I execute the return statement, I get the following error:
Code: Select all
"System.InvalidCastException: Specified cast is not valid.\r\n at Devart.Data.Linq.Engine.SingleKeyManager`2.a(Object A_0)\r\n at Devart.Data.Linq.Engine.KeyManager`2.b(Object A_0)\r\n at Devart.Data.Linq.Engine.ah.a(Expression A_0, Object& A_1)\r\n at Devart.Data.Linq.Engine.ah.e(Expression A_0)\r\n at Devart.Data.Linq.DataProvider.a(Expression A_0)\r\n at Devart.Data.Linq.Engine.DataQuery`1.System.Linq.IQueryProvider.Execute [S](Expression expression)\r\n at System.Linq.Queryable.FirstOrDefault [TSource](IQueryable`1 source)\r\n at StewDB.EXEMPTION.GetByPrimaryKey (StewDBDataContext db, Int32 lExemptionSeq) in c:\\Code\\Dev\\Exemption \\App_Code\\StewDBPartials.cs:line 101\r\n at ExemptionManager.cmdSearch_Click(Object sender, EventArgs e) in c:\\Code \\Dev\\Exemption\\ExemptionManager.aspx.cs:line 169"
"SELECT t1.EXEMPTION_SEQ, t1.EXEMPTION_DATE, t1.STATUS_SEQ, t1.RISK_SEQ, t1.START_DATE, t1.END_DATE, t1.DATE_APPROVED, t1.DATE_CLOSED, t1.CROP_SEQ, t1.REGION_SEQ, t1.LOCATION_SEQ, t1.REQUESTOR_LDAP, t1.SOP_DOC_NUMBER, t1.SECTIONS_AFFECTED, t1.CHANGE_SOP, t1.REQUEST, t1.REASON, t1.RISK_ASSESSMENT, t1.CONDITIONS, t1.EXEMPTION_NUMBER, t1.HISTORIC_EXEMPTION_NUMBER, t1.IS_REVIEWED\r\nFROM STEWARDSHIP.EXEMPTION t1\r\nWHERE t1.EXEMPTION_SEQ = 123"
Note the embedded \r\n's at the end? Where did those come from? I'm pretty sure that's what is causeing the problem and I'm also sure that my code has not changed from devart versoin 6.8 to 7.2. It's gotta be some change you folks made. Please help.
Thanks ... Ed