Its been posted before, but I've not found a satisfactory answer.
Environment: Dot-Net 2.0 beta, with Analysis Services 2005 beta.
DbDataAdapter produces DataColumns from its FillSchema method which
give me all sorts of information about the data type of the column.
AMO, the API for Analysis Services 2005, requires me to give an
OleDbType when I set up a foriegn key in a fact table and when I make
an Attribute.
(I'm using metadata as a starting point to scan a data warehouse and
build the dimensional model programatically. Think of it as a form of
Intellicube, but especially taylored to the structure of our data
warehouses feeding off our existing metadata.)
The thing is. I've used DbDataAdapter to FillSchema() to get the
underlying field types in the tables. It should _know_ what data type
is there as its just told me. I suppose the problem is that DataTable
class being generic can't know anything about specific databases, but
it would be nice if there was a method somewhere to take a DataColumn
and get the XXXDbType from it.
Analysis Services already knows the data type, as it's got a Data
Source View. I've presumably already told it once when I defined the
schema by passing in the DataSet that defined it - the DataSet made
using FillSchema.
Or have I? I'm building up a model that presumably hasn't been
committed yet, so presumably the problem is that there's no way (even
though I've given it a Connection String) for it to go to the database
and find out what it needs, and its not willing to wait until commit
time to work it out? Can I assume that the DataColumn doesn't have
enough information in itself? Therefore the Data Source View is, at
that time, incomplete, and I have to add the information myself from
an external source? If thats the case - it's not nice.
Also, as an aside, why (I'm following Microsoft's sample code) am I
using an OleDbDataType with an SQLServer database?
Thanks
- Richard