Datareader.Getfieldtype Returned Null

DataReader.GetFieldType returned null

Reference the Microsoft.SQLServer.Types dll from the project and for the reference set it as "Copy Local" in the properties of the reference. This will package that DLL up with the website when you deploy it. Then you don't need all of SQL Server installed on your web box in order to use the SQL Server data types. I did this for my website because it was using the geography data type columns and I was getting the same error.

Receiving DataReader.GetFieldType returned null. error.

I was able to finally get this working by adding a reference to

C:\Program Files (x86)\Microsoft SQL Server\110\Shared\Microsoft.SqlServer.Types.dll

and setting Copy Local to true. Odd that the nuget package worked for me in a different project, but not this one. Anyway, hope this helps somebody!

SqlServer Spatial DataReader.GetFieldType returned null

The nuget package Microsoft.SqlServer.Types is only for c# projects.

You can modify the class to be compatible with vb.net projects.

Install support into your project using:

Install-Package Microsoft.SqlServer.Types

Locate the following file:

/SqlServerTypes/Loader.cs

Convert the code in Loader.cs to vb (you can do this with an online converter) and save the file as: Loader.vb

Now you will be able to access the SqlServerTypes namespace from your project.

DataReader.GetFieldType(30) returned null

I already solve the issue.

The reference of Microsoft.SqlServer.Types should be on GAC

Plus, putting information in web.config

That fixed my problem



Related Topics



Leave a reply



Submit