You could modify the below snippet from ESRI Website
public void FindCommandAndExecute(ESRI.ArcGIS.Framework.IApplication application, System.String commandName)
{
ESRI.ArcGIS.Framework.ICommandBars commandBars = application.Document.CommandBars;
ESRI.ArcGIS.esriSystem.UID uid = new ESRI.ArcGIS.esriSystem.UIDClass();
uid.Value = commandName; // Example: "esriFramework.HelpContentsCommand" or "{D74B2F25-AC90-11D2-87F8-0000F8751720}"
ESRI.ArcGIS.Framework.ICommandItem commandItem = commandBars.Find(uid, false, false);
if (commandItem != null)
commandItem.Execute();
}
The identify tool's UID in 9.3 is {CF605583-AEA3-41D8-9464-DDD1905243D9}
or esriControls.ControlsMapIdentifyTool
I am not sure if it is same in version 10
Edit
I believe you are trying to pop up a custom attribute form with the attributes of the user selected feature.
I am assuming a case where where the "STREET_NAME" field value needs to get populated in a textbox. For this,
Find the ObjectId of the selected feature. Refer IFeatureSelection, IFeatureCursor etc..
//get the field values
IFeature pFeature = featureClass.GetFeature(objectid);
string streetName = pFeature.Value(pFeature.Fields.FindField("STREET_NAME"));
txtStreetName.Text = streetName;
If you are looking at creating dynamic userforms, you will need to loop all fields and field values.
Viewing the contents of a file geodatabase OR editing its contents using an Esri product, it doesn't matter which, will produce a .LOCK file inside the file GDB's folder on the file system which can be seen via Windows Explorer. It will contain some numbers in its filename, one of which refers to the process ID (PID) of the active process connecting to it. To know which process or application has your FGDB locked, open Task Manager and explore the contents of your GDB folder on the file system using Windows Explorer. Add the PID field to Task Manager and then compare the process IDs in Task Manager to that of the lock file to identify the culprit. The presence of the .LOCK file is essentially an exclusive lock and won't allow you to do much else other than view the FGDB contents until it is gone. Killing those connections can be done by ending the process brutally in Task Manager or gracefully closing an application or stopping a GIS service, if applicable.
Now, if there is no lock file or process holding on to the FGDB, then you probably have a system lock of some sort that hasn't cleared up. Rebooting should resolve that; but if rebooting isn't possible then you'll need to close the FGDB files manually. If you have Windows 7 or Server 2008 R2 or higher, read on:
If you are still having issues with deleting a geodatabase on the file system despite the fact that the .lock files no longer exist, it's possible there is still a process lock on one or more of the files within it. That being said, if you're using Windows Server 2008 / Windows 7 or later you can try one of the following methods:
From the Start menu, type FSMGMT.MSC, then multi-select the files you want from the GUI, then right click them and chose "Close". That method should force close the files that are technically still open due to a process lock.
or
From a batch file, run the following (example is for a file geodatabase) to close a file named a00000225.gdbtable (this filename is just an example):
cd C:\this_server\directory\subdirectory
for /f "skip=4 tokens=1,2*" %%a in ('net files') do if %%b == C:\this_server...\a00000225.gdbtable net file %%a /close
You can modify the command above to loop through all of the files in the file geodatabase to close them all rather than specify them individually, which would be tedious since there are so many.
From the command prompt, type NET FILES to see what the bold text above should contain.
Remember that double percent characters are required for batch files (in other words, %% rather than %) but single percent characters are used when running the command outside of a batch script.
Best Answer
2 workarounds: assumption here is personal geodatabase (.mdb)
1.delete the .ldb (whilst Arcmap is open - by removing the layers) delete in windows explorer. Then do 'undo' remove layers. search *.ldb for multiple
2.move up a few folder levels in ArcCatalog and Refresh, it will unlock the file and you can edit in ArcMap.
file .gdb [or .mdb] is at c:\work\project\data, if you view the c:\work\ folder and click refresh in ArcCatalog
Schema Locks http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Schema%20locking