Showing posts with label getting. Show all posts
Showing posts with label getting. Show all posts

Monday, March 2, 2015

C SQLCLR SqlMetaData with SqlDbType Float column getting InvalidCastException on SqlDataRecord SetFloat

In my SQLCLR C# Stored Procedure on SQL Server 2008 R2 i returned the results using a SqlDataRecord that has a column of SqlDbType.Float.

Trying to set the value using the SetFloat Method, i got an InvalidCastException.

How-i-fixed-it:
I found out that SqlDbType.Float is equal to a System.Double data type. Using the SetDouble Method it works fine.

Here i found the right hints:
http://msdn.microsoft.com/de-de/library/vstudio/system.data.sqldbtype(v=vs.80).aspx

http://msdn.microsoft.com/de-de/library/vstudio/microsoft.sqlserver.server.sqldatarecord.setfloat.aspx

http://msdn.microsoft.com/de-de/library/vstudio/microsoft.sqlserver.server.sqldatarecord.setdouble.aspx






 




 
Read more »

Saturday, February 28, 2015

Installing Visual Studio Tools for Applications 2012 after getting Compatibility mode error

I went to use the developer tab of InfoPath 2013 and it told me that I needed to download the Visual Studio Tools for Applications 2012.  They were even nice enough to include a link!
When I downloaded the file and ran it, I got this error:
Setup Blocked, Windows Program Compatibility mode is on.  Turn it off and then try setup again.
I was not using Compatibility mode, and so this error didnt make sense.
Im running Windows 8.1 with Update 1 and I didnt know if that was related.


I tried everything..  I installed the full Visual Studio 2012 Suite with Office Tools, I installed the VS2012 SDK, and still nothing worked and this wouldnt install.

Here is some of what I found in the log when it fails.

[15EC:11C4][2014-05-28T19:06:50]: Condition CompatibilityMode = 0 evaluates to true.
[15EC:11C4][2014-05-28T19:06:50]: Condition (VersionNT < v6.1) evaluates to false.
[15EC:11C4][2014-05-28T19:06:50]: Condition (NOT netfxfullredist_43_DetectKeyExists) OR (netfxfullredist_43_DetectKey < v4.5) evaluates to false.
[15EC:11C4][2014-05-28T19:06:50]: MUX:  Stop Block: CompatibilityMode : Windows Program Compatibility mode is on. Turn it off and then try Setup again.

The version I was using was published on 4/30/2013 and is here

Turns out that if you rename your download (vsta_setup.exe) to something else, it will not run correctly.  You must leave the name alone when you download it.  For example, if you download it twice and the second download is called vsta_setup (1).exe, executing that file will not work!

Hope this helps!



Read more »