I'm trying to write a C# console application to convert a CSV of Lat,Lon data into a Table using insert/update cursors. However, I am having the darndest time figuring out how to get a reference to an ITable without first opening an instance of ArcMap. How would it be done?

The purpose is to open a table inside a geodatabase that exists. After I have a reference to it, I can create an insert cursor and turn the CSV into a proper table inside the geodatabase directly without bothering with Access (the devil).

  • Are you wanting to open the csv file as an ITable, or just the output table? – Kirk Kuykendall Jun 9 '11 at 1:58
  • Just the output table. – Nathanus Jun 9 '11 at 14:49

I like the IGPUtilities interface. It has methods for opening feature classes and tables from an ArcCatalog-style path which can save you dozens of lines of code.

The one you probably want is the OpenTableFromString method.

This is assuming the table exists, of course. If you need to create it then I am sure it's a bit more involved.

| improve this answer | |
  • When it asks for an ArcCatalog path, it's just referring to what can be seen in the address bar of ArcCatalog, right? – Nathanus Jun 9 '11 at 14:13
  • Never mind, I figured it out! Thank you, this works perfectly. – Nathanus Jun 9 '11 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.