Windows error 0x80131931, -2146232015

Detailed Error Information

COR_E_SqlNullValue[1]

HRESULT analysis[2]

FlagsSeverityFailure
Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode19 (0x013)
NameFACILITY_URT[2][3]
DescriptionThe source of the error code is .NET CLR.[2][3]
Error Code6449 (0x1931)

Questions

5votes
1answer

How do I solve SqlNullValueException?

I'm trying to find an entity but I get a SqlNullValueException when entity framework is trying to get the value of a field that's Null. I checked in the database and all the not nullable fields are filled. The only fields that have a NULL value are the ones that [...] read more
c#
sql-server
entity-framework
.net-core
entity-framework-core
3votes
1answer

SqlNullValueException when executing a stored procedure with MySqlCommand

I'm writing a C# application to retrieve recipes from a MySQL database, using Dapper for ORM. So far, I've written my DAL in C# with direct queries (Which I know is unsafe), and this works great. I've now started to transition over to stored procedures with parameters to better protect [...] read more
c#
mysql
stored-procedures
orm
dapper
0votes
1answer

System.Data.SqlTypes.SqlNullValueException after I migrated to net5.0 from netcore 3.1

I'm getting this error on one of my fetch services > System.Data.SqlTypes.SqlNullValueException HResult=0x80131931 > Message=Data is Null. This method or property cannot be called on Null values. > Source=Microsoft.Data.SqlClient StackTrace: at > Microsoft.Data.SqlClient.SqlBuffer.get_Int32() at > Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.Enumerator.MoveNext() > at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at > System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at > Infrastructure.Data.Repository.Base.EfRepository1.List(ISpecification1 spec) > in [...] read more
asp.net-core
.net-5
nullable-reference-types
asp.net-core-5.0
ef-core-5.0
0votes
1answer

I get a an error when the Date is null but cannot understand why and how to fix it

This is driving me crazy: using (var context = new aContext()) { _Paz = context.TPaz .Where(a => a.CodPaz == _PazV.CodPaz) .FirstOrDefault(); } I have 2 different rows, on the first one everything is perfect. On the second one I get the error Here the definitions: [Table("tPAZ")] public partial class TPaz [...] read more
sql-server
linq
null
entity-framework-core

Comments

Leave a comment

(plain text only)

Sources

  1. https://github.com/dotnet/coreclr/blob/v1.1.0/src/inc/corerror.xml
  2. https://msdn.microsoft.com/en-us/library/cc231198.aspx
  3. winerror.h from Windows SDK 10.0.14393.0

User contributions licensed under CC BY-SA 3.0