J
Jiho Han
I am trying to retrieve the database type (in this case OleDbType actually)
from a DataSet created via DataAdapter.Fill method.
When I retrieve a result set via OleDbDataReader, I can use its GetDataTypeName(int
index) which will give me the underlying type such as:
"DBTYPE_DBTIMESTAMP"
"DBTYPE_CHAR"
It's returned as a string value - let me know if there is a method to get
it as a OleDbType -, but I can map them back to OleDbType. The reason I
need this info is so that I can build insert/update/delete commands from
the loaded schema info (I've tried CommandBuilder, but decided not to use
it since it not only seem to create funky sql but invalid ones as well).
I get a DataSet/DataTable back after calling Fill but the underlying type
information is no longer accessible.
DataColumn class has DataType property but it's a .NET type. I looked in
ExtendedProperties just in case but nothing there either.
The XML schema returned from the dataset will say xs:string, restriction
12, for char(12) type versus xs:string, restriction 64, for varchar(64).
This doesn't seem to be too big a deal since there seem to be some automatic
conversion down the line.
My current workaround would be to load the schema info via OleDbDataReader
and store it somewhere to use later.
If anyone can share some insights regarding the above, I'd appreciate it.
Thanks
Jiho Han
Senior Software Engineer
Infinity Info Systems
The Sales Technology Experts
Tel: 212.563.4400 x216
Fax: 212.760.0540
(e-mail address removed)
www.infinityinfo.com
from a DataSet created via DataAdapter.Fill method.
When I retrieve a result set via OleDbDataReader, I can use its GetDataTypeName(int
index) which will give me the underlying type such as:
"DBTYPE_DBTIMESTAMP"
"DBTYPE_CHAR"
It's returned as a string value - let me know if there is a method to get
it as a OleDbType -, but I can map them back to OleDbType. The reason I
need this info is so that I can build insert/update/delete commands from
the loaded schema info (I've tried CommandBuilder, but decided not to use
it since it not only seem to create funky sql but invalid ones as well).
I get a DataSet/DataTable back after calling Fill but the underlying type
information is no longer accessible.
DataColumn class has DataType property but it's a .NET type. I looked in
ExtendedProperties just in case but nothing there either.
The XML schema returned from the dataset will say xs:string, restriction
12, for char(12) type versus xs:string, restriction 64, for varchar(64).
This doesn't seem to be too big a deal since there seem to be some automatic
conversion down the line.
My current workaround would be to load the schema info via OleDbDataReader
and store it somewhere to use later.
If anyone can share some insights regarding the above, I'd appreciate it.
Thanks
Jiho Han
Senior Software Engineer
Infinity Info Systems
The Sales Technology Experts
Tel: 212.563.4400 x216
Fax: 212.760.0540
(e-mail address removed)
www.infinityinfo.com