• C

C# app, strange runtime behaviour

I've just encountered a wierd problem.
The following piece of code (using VS2010) works
SNAG-0028.bmpand, on the same PC, the following piece of code (using VS2015) fails
SNAG-0029.bmp
Any ideas as to what is going on - I just copied and pasted the file from one project to a newer one.
LVL 45
AndyAinscowFreelance programmer / ConsultantAsked:
Who is Participating?
 
AndyAinscowConnect With a Mentor Freelance programmer / ConsultantAuthor Commented:
I've tried it and it doesn't make any difference.

Meanwhile I have found it is an x86 / x64 conflict.  Changing the solution property settings cured it.
0
 
Pawan KumarDatabase ExpertCommented:
Prefix @ before Provider keyword in the connection string.
0
 
AndyAinscowFreelance programmer / ConsultantAuthor Commented:
No it isn't that, the code is identical.
0
 
Pawan KumarDatabase ExpertCommented:
Yes it is the VS 2015. If you Prefix @ before Provider keyword in the connection string then it will work.
0
 
AndyAinscowFreelance programmer / ConsultantAuthor Commented:
32/64 bit compilation problem, only one of those options had the provider installed.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.