Default values in dataTable
- From: "Vladimir Oľura" <vladimir.ozura@xxxxxx>
- Date: Tue, 4 Oct 2005 19:09:31 +0200
I am building a Pocket PC application in C# and I tryed to get the Default
values of columns in a given table with the following SqlCeCommand:
SqlCeCommand columns = new SqlCeCommand(@"SELECT COLUMN_NAME, TYPE_NAME,
COLUMN_DEFAULT FROM INFORMATION_SCHEMA.COLUMNS,
INFORMATION_SCHEMA.PROVIDER_TYPES WHERE
INFORMATION_SCHEMA.COLUMNS.DATA_TYPE=INFORMATION_SCHEMA.PROVIDER_TYPES.DATA_
TYPE AND TYPE_NAME NOT IN
('ntext','nchar','image','binary','varbinary','uniqueidentifier') AND
COLUMN_NAME NOT IN ('s_Generation') AND TABLE_NAME = ?", this.sqlce);
When I Execute the command and try to read the COLUMN_DEFAULT "String" with
the following command:
dtr.GetString(2);
I get an SqlNullValueException. I know that the default value in the
database is set to NULL, but can't you read a NULL value and then set the
defautl value in a dataTable to NULL?
Is there another way to get that COLUMN_DEFAULT without getting the
exception?
THANKS!!!
.
- Follow-Ups:
- Re: Default values in dataTable
- From: Darren Shaffer
- Re: Default values in dataTable
- Prev by Date: Re: Merge replication without IIS?
- Next by Date: Re: Copying tables
- Previous by thread: Re: Merge replication without IIS?
- Next by thread: Re: Default values in dataTable
- Index(es):
Relevant Pages
|
Loading