C
Christopher
Hi,
i am writing a small interface to import some data from one database to
an other database. unfortunately is the data in the source not very
"nice". you have boolean-columns and those boolean-columns have as a
default value DBNULL.
it wouldn't be a problem if there was one boolean field, i would have a
if (table.iscolumnNull()) but i have about 70 boolean fields and only
ONE is true all others are false. that means i have many of those ifs
already
if (table.column1)
{
}
else if (table.column2)
the problem is, i don't want to have a structure like this:
if (table.column1IsNull())
{
if (table.column1){}
}
else if (table.column2IsNull())
....
I hope you can see where I am going.
So I think there must be a possibility to change the DBNULL-values
within the fill-method of the table-adapter.
something like
select
case
when column1=null then column1=false
else column1
endcase
from foreigntable
i have tried to write such a statement but it didn't work out. If
somebody had some hint, that'll be great!
Greetings
Chris
i am writing a small interface to import some data from one database to
an other database. unfortunately is the data in the source not very
"nice". you have boolean-columns and those boolean-columns have as a
default value DBNULL.
it wouldn't be a problem if there was one boolean field, i would have a
if (table.iscolumnNull()) but i have about 70 boolean fields and only
ONE is true all others are false. that means i have many of those ifs
already
if (table.column1)
{
}
else if (table.column2)
the problem is, i don't want to have a structure like this:
if (table.column1IsNull())
{
if (table.column1){}
}
else if (table.column2IsNull())
....
I hope you can see where I am going.
So I think there must be a possibility to change the DBNULL-values
within the fill-method of the table-adapter.
something like
select
case
when column1=null then column1=false
else column1
endcase
from foreigntable
i have tried to write such a statement but it didn't work out. If
somebody had some hint, that'll be great!
Greetings
Chris