c#


DataReader.GetFieldType(30) returned null


An exception of type 'System.InvalidOperationException' occurred in System.Data.dll but was not handled in user code
Additional information: DataReader.GetFieldType(30) returned null.
I tried all the fixes issued here on stackoverflow but it seems that it does not work on my part.
I'm working with an issue regarding Geography in SQLServer database. I don't have any issue with regards to other datatype but when a column have already a Geography. It produces an error.
I try to put Microsoft.SqlServer.Types.dll in the bin folder and reference it on the project. Same error occur.
{
"Message": "An error has occurred.",
"ExceptionMessage": "DataReader.GetFieldType(30) returned null.",
"ExceptionType": "System.InvalidOperationException",
"StackTrace": " at System.Data.ProviderBase.SchemaMapping.SetupSchemaWithKeyInfo(MissingMappingAction mappingAction, MissingSchemaAction schemaAction, Boolean gettingData, DataColumn parentChapterColumn, Object chapterValue)\r\n at System.Data.ProviderBase.SchemaMapping..ctor(DataAdapter adapter, DataSet dataset, DataTable datatable, DataReaderContainer dataReader, Boolean keyInfo, SchemaType schemaType, String sourceTableName, Boolean gettingData, DataColumn parentChapterColumn, Object parentChapterValue)\r\n at System.Data.Common.DataAdapter.FillMappingInternal(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 schemaCount, DataColumn parentChapterColumn, Object parentChapterValue)\r\n at System.Data.Common.DataAdapter.FillMapping(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 schemaCount, DataColumn parentChapterColumn, Object parentChapterValue)\r\n at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)\r\n at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)\r\n at System.Data.Common.LoadAdapter.FillFromReader(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)\r\n at System.Data.DataTable.Load(IDataReader reader, LoadOption loadOption, FillErrorEventHandler errorHandler)\r\n at System.Data.DataTable.Load(IDataReader reader)\r\n at Arbiter.Core.BaseHelper.ExecuteReader()\r\n at Arbiter.Helpers.SqlHelper.RetrieveT\r\n at GjenesisServices.Models.DataAccessLayer`1.Retrieve(String command, Object[] parameters)
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 Links

NodaTime TypeInitializationException Device Only, Release Only
How to keep proper aspect ratio of my application on widescreen monitor?
Hide sqlcmd in c# application
How to convert byte data to double or float?
Type conversion and typeof
A way to concatenate Console.Beep sounds
EntityFramework - Cannot Delete Entity using DbSet [duplicate]
DirectoryInfo.EnumerateFiles() Extreme Slow in Debug Mode
Is it possible to return all columns data of an entity in Entity Framework
Match only the begining of the string in a MongoDB query
Creating a new Queue Manager and Queue in Websphere MQ (using C#)
OpenXML SDK: get presentation shape location
what happens behind the seen on closing window in C# wpf
SeriesChartType.Point all point have a square shape
Parsing using C#
Model binder not working with JSON POST

Categories

HOME
drupal
javafx
botframework
process
openacc
microcontroller
overrides
mingw
mediarecorder
flowtype
google-api-oauth
genexus
ephesoft
annyang
soap-client
openbsd
facebook-sharer
hdf5
ofbiz
airbnb
audio-streaming
formulas
android-navigation-drawer
advertising
aws-certificate-manager
akavache
android-cursorloader
mex
ocl
loopback
imdb
odp.net
ponylang
mockserver
keychain
quartz
contenteditable
php-mongodb
f#-fake
synchronized
automapper-4
denodo
runtime-permissions
xamarin-test-cloud
multi-targeting
mavlink
alfred
visual-web-developer
git-push
networkstream
syslog4j
normalisation
db2-zos
nsoperationqueue
razorengine
web-optimization
redquerybuilder
om
traminer
tooltwist
polarion
playn
firewire
clearquest
genero
gmaps4jsf
nexusdb
caption
system.net
sat4j
oxygenxml
disparity-mapping
dotcmis
rpt
traceur
svg-android
sygic
symbian3
qt5.1
tasklist
waveout
towerjs
apache-commons-email
hwnd
lgpl
p4.net
hp-trim
datadude
time-management
ihtmldocument2
user-preferences
jettison

Resources

Encrypt Message