none
Implicit casting of value type into a SqlParameter regression failure RRS feed

  • General discussion

  • I'm not sure if this is in the right forum, please let me know where it belongs if not. It appears to be related to the SqlParameter and SqlDBTypes class specifically.

    Write the following code:

     SqlParameter s = new SqlParameter("@test", (double)0) ;
     Console.WriteLine(s.Value);

    in VS2005, and VS2008 targeting .NET Framework 2.0.

    VS2005 will return 0.0, the expected value.

    VS2008 returns null

    Is this a bug? I thought VS2008 targeting 2.0 was supposed to give identical results as compiling VS2005 in 2.0. If this is not true, isn't serious regression testing necessary when upgrading projects from 2005 to 2008?




    Wednesday, March 25, 2009 11:50 PM

All replies

  • Each release of VS usually has a small number of breaking changes. For a list of C# compiler changes in VS2008, have a look here: http://msdn.microsoft.com/en-us/library/cc713578.aspx


    Postings are provided "As Is" with no warranties and confer no rights.
    Monday, March 15, 2010 11:38 PM
  • By the way, here is another thread that deals with the same issue:

     

    http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/92e280f9-78ad-401f-bcf2-489f9de3425e


    Postings are provided "As Is" with no warranties and confer no rights.
    Tuesday, March 23, 2010 1:46 AM