1

If you are using a SQL Server database and you want to store null and non null values read from the database, which .NET data types are best suited, NULLABLE native types or SQLTypes?

I don't care about db portability to a different db.

1 Answer 1

1

This 100% depends on what you're going to do with it. If you're interacting with SqlCommands and associates, you for example have to use DbNull. However, my experience is that its usefulness stops there. With the rest of .NET, you're better off with native types. WPF for instance now supports Nullable<bool> for CheckBox.IsChecked which binds very well to native types, but not as nicely to the SQL types.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.