Database Data Types

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
J

Jonathan Wood

The further I delve into .NET and ADO.NET, the more things I seem to find
missing that we had 10 or 15 years ago. I really don't understand why.

So, using VS to create an SQL database I see:

1. There is no Boolean data type. Further, if I use tinyint and set it's
default value to 0, I see that it defaults to NULL, which causes an error if
I don't set it before I try to save a new record.

2. There is a money type, but it appears that is just an alias for decimal
or something. Once data is entered, it is automatically formatted something
like "39.9500".

Can anyone tell me how they are dealing with these limitations?

Thanks.
 
Hi Jonathan,

Jonathan Wood said:
The further I delve into .NET and ADO.NET, the more things I seem to find
missing that we had 10 or 15 years ago. I really don't understand why.

So, using VS to create an SQL database I see:

What exactly are you doing?
1. There is no Boolean data type. Further, if I use tinyint and set it's
default value to 0, I see that it defaults to NULL, which causes an error
if I don't set it before I try to save a new record.

2. There is a money type, but it appears that is just an alias for decimal
or something. Once data is entered, it is automatically formatted
something like "39.9500".

Data formatting is in the UI domain, not database domain. There are several
ways of formatting, depending on the UI controls you are using.
 
Miha,
What exactly are you doing?

Creating a table. That's the only place I'm aware of where data types are
specified.
Data formatting is in the UI domain, not database domain. There are
several ways of formatting, depending on the UI controls you are using.

The table designer provides a default value property, yet it seems to be
ignored. I don't see that as being in the UI domain.
 
Jonathan Wood said:
Miha,


Creating a table. That's the only place I'm aware of where data types are
specified.

But how are you creating a table? Using server explorer? Then there are
types bit (boolean) and numeric(n,m).
Or are you reffering to DataTable?
The table designer provides a default value property, yet it seems to be
ignored. I don't see that as being in the UI domain.

Value formating is alyways in UI domain. Why should data tier deal with
formatting?
Anyway, try with numeric(n,m) datataype.
 
Miha,
But how are you creating a table? Using server explorer? Then there are
types bit (boolean) and numeric(n,m).
Or are you reffering to DataTable?

As I indicated, in Visual Studio 2005. Whatever you want to call that table
designer.
Value formating is alyways in UI domain. Why should data tier deal with
formatting?

Again, I do not consider a default value to be related to formatting or the
UI domain.
Anyway, try with numeric(n,m) datataype.

I'll look into it.
 
Back
Top