Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Krishna-Maiden opened this issue Jun 13, 2023 · 4 comments
Open

Comments

@Krishna-Maiden
Copy link

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...

@ahmad-moussawi
Copy link
Contributor

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

@Krishna-Maiden
Copy link
Author

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

@ahmad-moussawi
Copy link
Contributor

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

@Krishna-Maiden
Copy link
Author

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants