Jet 4.0, ISAM and Excel

  • Thread starter Thread starter Oriane
  • Start date Start date
O

Oriane

Hi,

when I read an excel column containing numbers with Jet 4.0, and fill a dataset, I obtain a "System.Double" datatype. I would prefer to have a System.Integer value, to fill a sql database column...

Some ideas ?

Oriane
 
Optionally, I've tried to change the data type of the sql column. I've tried (unsuccessfully) numeric, bigint, real, float...but nothing matchs with the System.Double .NET type.

"Oriane" <[email protected]> a écrit dans le message de %[email protected]...
Hi,

when I read an excel column containing numbers with Jet 4.0, and fill a dataset, I obtain a "System.Double" datatype. I would prefer to have a System.Integer value, to fill a sql database column...

Some ideas ?

Oriane
 
¤ Hi,
¤
¤ when I read an excel column containing numbers with Jet 4.0, and fill a dataset, I obtain a "System.Double" datatype. I would prefer to have a System.Integer value, to fill a sql database column...
¤
¤ Some ideas ?

I don't believe there is anything you can do about this. System.Double is the default data type for
Excel columns that contain numeric values.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Hi,

when I read an excel column containing numbers with Jet 4.0, and fill a
dataset, I obtain a "System.Double" datatype. I would prefer to have a
System.Integer value, to fill a sql database column...

Some ideas ?

Oriane

If you know it should be an integer, you can do a typecast. Excel will use
double by default even if you enter something that you think is an integer.

(/fredrik
 
¤ Hi Paul,
¤
¤ so what's the matching Sql Serve type: numeric, float ?
¤
¤ Thanks

The value should convert to a numeric OK. What is it you're trying to do?


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Paul Clement said:
¤ Hi Paul,
¤
¤ so what's the matching Sql Serve type: numeric, float ?
¤
¤ Thanks

The value should convert to a numeric OK. What is it you're trying to do?
I read an Excel sheet, make a dataset, and merge it with an other dataset filled with an sql dataadapter.
I think that I will have to cast the System.Double column to Integer, before merging it with the sql dataset.

Bye
 
Back
Top