DataReader.GetFieldType returned null

后端 未结 6 1747
北荒
北荒 2021-01-01 17:46

In my db table Layout, there\'s one column whose type is hierarchyid (column index=4). When trying to set-up new environment (a virtual web-server, created from

6条回答
  •  梦谈多话
    2021-01-01 18:12

    Rather than changing your project and adding a reference to Microsoft.SQLServer.Types dll you could just put it into the GAC.

    In my case I had three versions on my dev machine and added them to the server GAC:

     gacutil.exe -i .\10.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Types.dll
     gacutil.exe -i .\11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Types.dll
     gacutil.exe -i .\12.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Types.dll
    

    I had other SQL related third party .NET tools on the server that had the same error. After adding the assemblies to the GAC, they all worked fine.

    While I don't put my own assemblies into the GAC, I think it is okay to put some Microsoft SQL-Server assemblies there because they affect multiple applications.

提交回复
热议问题