From: Jason V. <jas...@ya...> - 2003-06-26 04:18:41
|
From your previous answer, which now that I look at it I should have been able to find myself, using the FbType enumeration corrects the problem for me. However, I'm writing in C++, using the interop services within a single managed C++ module (the rest of the application is unmanaged), so the behavior could be different because of this. I can't post the exact code (non-disclosure contracts prevent me), but here's the "psuedo-code" example (unchecked, so I don't even know if this actually compiles) of what's happening: Once I get the datatable (similar to your C# example), I have this: for (short c=0;c<c_count;c++) { DataColumn * col = columns->get_Item( c ); Object *o = row->get_Item( col ); switch( Type::GetTypeCode( o->GetType() ) ) { ...// enumerating the various typecodes from TypeCode::Decimal, etc. (they all work as expected) ..// for the "DataType" column, this case fires... case TypeCode::Object: { Type *t = o->GetType(); n = Type::GetTypeCode(t); // n is always 1 } break; } In this example, what I get is an "Object", from which I get a type, and then a typecode. I'm not sure why - it's the only field that does this (the ProviderType gives me a number, as expected), and I've not yet checked the MsSQL2000 version (I'm doing both side by side) to see if it does the same thing - I think it does (which would suggest the problem isn't your provider). __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com |