John Stagich's Blog

Microsoft .Net Developer

March 2012 Quick Hits

clock March 16, 2012 09:28 by author JohnStagich
  • Here is a link to SQL Server Data Type Mappings documentation that I found helpful in understanding how SQL data types map to .NET data types and what SQL DataReader typed accessor (e.g., GetString and GeBoolean) is needed to read a particular SQL data type from within .NET.

  • A good link on how the retrieve the Microsoft SQL rowversion/timestamp value from the standard IDataReader interface.  Below is how I implemented.

    byte[] rowVersionBuffer = new byte[8];
    dataReader.GetBytes(rowVersionField_OrdinalValue, 0, rowVersionBuffer, 8);  // rowversion storage size is 8 bytes.  timestamp is a synonym for rowversion.
    businessObject.RowVersion = rowVersionBuffer;

    // business object rowversion/timestamp property

    private byte[] _RowVersion
    public byte[] RowVersion
    {
       get { return _RowVersion;}
       set { _RowVersion = value; }
    }

  • jsfiddle  A tool to test HTML, CSS, and JavaScript.


.NET Compile Problem: Referenced assembly could not be resolved

clock March 6, 2012 10:31 by author JohnStagich

I was working on a Visual Studio 2010 VB.Net Windows Service application.  I added a reference to an in-house IO library and then used the Imports keyword to import the namespace from the referenced assembly.  IntelliSense recognized the namespace and I had access to the methods in the IO library.

I then tried to compile the application.  It failed.  My Imports statement for the IO library and the methods I used with that library generated error messages.  Along with the errors, I noticed a warning message.  The warning message provided the clue to the solution.  It mentioned that the referenced IO assembly could not be resolved because it had a dependency on System.Data.OracleClient.

Here is the link where I found the solution (thanks Xiaoyu!).  It turns out that when I added the new Windows Service project, the targeted framework was for the .NET Framework 4 Client Profile.  That framework does not include the System.Data.OracleClient.dll. 

The fix: Change the target framework to .NET Framework 4 (Project Properties -> Compile tab -> Advanced Compile Options… -> Target framework drop down).

 



About the author

I am the owner of Stagich Software Consulting.  Stagich Software Consulting specializes in developing Microsoft .Net/Microsoft SQL software applications.

 

Calendar

<<  April 2024  >>
MoTuWeThFrSaSu
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

View posts in large calendar

Month List

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Sign In