sqlkata/querybuilder

Issue in SQL Server - Unable to set null value to column in db

Krishna-Maiden opened this issue · 4 comments

I have tried setting the null value like below
map[keyValuePair.Key] = DBNull.Value;

but I am receiving exception 'The member p3 of type System.DBNull cannot be used as a parameter value'

if I dont add code, its saving as 'NULL' with string datatype.. which is wrong...

Can you post more details about what you are trying to achieve?
and the database/SqlKata/dotnet version?

in react I am trying to set update value to Null in SQL Server through .NET.

var json = { test: '' } -- this will save empty string
json = { test: null } -- this will save 'null' string.. my requirement is null value

using latest sql meta library for this

Sorry @Krishna-Maiden, this is not enough to explain the issue. Could you please post the minimum reproducible steps for your issue?

var student = {
name: 'Arjun',
gender: null
}

in C# it is setting empty string for gender.. and saving empty for this column.