Elizabeth,
Sorry, FGDB is short or internal slang for File Geodatabase. Are you required to use Shapefiles or can you write out a geocoded points to a newer type of format? If you can write the geocoding results into a File Geodatabase instead of a Shapefile, you might get rid of your locking issue.
Brad
I am not required to use shapefiles. Like I said, that is just what we are using. And I have 2 weeks to get all this working and integrated. I have 3 shapefiles we use to display on the map. This is a layer I am creating to display our active calls. If it will give me the same access and stuff that a shapefile can, I am all for changing this. Right now, this is the only layer I am concerned with. Because we also add annotations/labels to the calls so when can see the call ID and units assigned as well as right click on the call and see details. So if I can still do that, that would be great.
Elizabeth,
This is what you would need to do to switch to using a File Geodatabase. First create one in ArcMap in some folder of choice. Next you will need to modify your code to write to and read from that File Geodatabase instead. From the code I have seen that would be modifications to the following:
The output featureClass when doing the geocoding would look something like this now:
String outputFC = @"C:\geocoding\redlands\GeocodingResults.gdb\redlands_addr_geocoded";
Also when getting the geocoded featureClass you would need to change this to open the FGDB instead:
IWorkspaceFactory2 workspaceFactory = new FileGDBWorkspaceFactoryClass() as IWorkspaceFactory2;
IWorkspace workspace = workspaceFactory.OpenFromFile(@"C:\geocoding\redlands\GeocodingResults.gdb", 0);
That should be it.
Brad
Would everything be the same doing it that way. I mean I have a gdb. It creates one when you create an mxd. I am just trying to think of how much work this might be. But since I am stuck anyway... Fix something and hit another road block. LOL
UPDATE - I guess I lied. I have a default gdb. How do I create a new one? Can I use my existing map or do I have to create a new map?
This is all I see
Your user has a default file geodatabase, and it's on you local computer. Are you sure you want to depend on that? I don't know where you are storing your shapefiles, but I would suggest a mapped network drive somewhere that gets backed up, and is accessible to your app...
Elizabeth,
All you need to do in ArcMap is right click in any folder in Catalog and select New > File Geodatabase
As far as I know, everything else would still be the same. The only difference is writing to and reading from the FGDB now.
Brad
Ok got that. How does this work? I have my 3 shapefiles from the client. How do i associate those with the GDB? Or do I not worry about that?
It didn't show my new layer on my map? I am confused how this is supposed to work.
A file geodatabase is nothing more than a container. You'll need to get your shapefiles into the new file geodatabase. See An overview of adding datasets to the geodatabase—ArcGIS Help | ArcGIS Desktop for details.