Select to view content in your preferred language

Type.GetTypeFromProgID("esriDataSourcesOleDB.TextFileWorkspaceFactory") returns null

2031
6
Jump to solution
08-20-2012 09:52 AM
AnatoliyZharkikh
New Contributor
Hi, I just barely upgraded to 10.1 and I noticed a new problem that I can't figure out the solution to. My addin relies on being able to load in a csv file and the following line gives me null:

Type factoryType = Type.GetTypeFromProgID("esriDataSourcesOleDB.TextFileWorkspaceFactory");


This worked just fine in 10.0 and now I got holes in my program. Anyone know a workaround?

Thanks,
Toly
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
BrentPierce
Esri Contributor
Toly,

TextFileWorkspaces changed slightly in the 10.1 release of ArcGIS, if you modify your code in this way it should work in 10.1.

Type factoryType = Type.GetTypeFromProgID("esriDataSourcesFile.TextFileWorkspaceFactory");


Hope this helps,
-Brent

View solution in original post

0 Kudos
6 Replies
RichardWatson
Deactivated User
http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//00010000043p000000

Why not use the actual type instead of looking it up via the ProgID:

http://edndoc.esri.com/arcobjects/9.2/NET/c68303f6-8360-40c0-9faa-e0efdcc44c86.htm

Just add a reference to ESRI.ArcGIS.DataSourcesOleDB.dll and then use the class.
0 Kudos
by Anonymous User
Not applicable
With ArcGIS Server it's not possible to register OLE DB connections with the data store.  See here.  This might be the problem.  It would help if you explain more about what your add-in does in ArcMap and how it makes use of ArcGIS Server.

Regards,
Doug Carroll, ESRI Support Services
http://support.esri.com/
0 Kudos
BrentPierce
Esri Contributor
Toly,

TextFileWorkspaces changed slightly in the 10.1 release of ArcGIS, if you modify your code in this way it should work in 10.1.

Type factoryType = Type.GetTypeFromProgID("esriDataSourcesFile.TextFileWorkspaceFactory");


Hope this helps,
-Brent
0 Kudos
FridjofSchmidt
Frequent Contributor
Toly,

TextFileWorkspaces changed slightly in the 10.1 release of ArcGIS, if you modify your code in this way it should work in 10.1.

Type factoryType = Type.GetTypeFromProgID("esriDataSourcesFile.TextFileWorkspaceFactory");


Hope this helps,
-Brent


Brent,

Thanks for the hint. I just found this thread because I had the same issue. It would be helpful if the pages http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Interacting_with_singleton_objec... and http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//000100000408000000 reflected the change.

Cheers
0 Kudos
ElizabethWare1
Emerging Contributor

I am doing this, but still having an issue opening my csv file. It doesn't really give me an error. Anyone run into this issue? 

0 Kudos
ElizabethWare1
Emerging Contributor

And I have tried it both ways (direct reference and by Type).

0 Kudos