Reputation: 24679
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.
Upvotes: 1
Views: 114
Reputation: 29632
This 100% depends on what you're going to do with it. If you're interacting with SqlCommand
s 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.
Upvotes: 1