Monthly Archives: May 2011

ArcSDE 10: DBMS table not found [*********][STATE_ID=0]

I recently bumped into a problem when moving my development ArcSDE Geodatabase to another machine. The ArcSDE Geodatabase is running on MS SQL Standard* and is using schema’s to store data for different projects.

After restoring the database on the new machine and trying to access it in ArcCatalog I got the following error message:

DBMS table not found [*********][STATE_ID=0]

This lead me to ArcGIS bug report NIM059178 / Article ID: 38048.

Which has a patch attached, but this patch only solved the connectivity within ArcCatalog and didn’t solve the problem when accessing the ArcSDE from my Python scripts (through the ArcGIS REST Services).

After some digging around I discovered that I didn’t install ArcSDE Service Pack 1 yet. Bug NIM059178 is also part of this Service Pack. Shame on me!

I also took the opportunity to install ArcSDE Service Pack 2, but this SP isn’t necessary to solve this specific issue.

All the different ArcGIS packages (Desktop, Services, etc) have a copy of SP1 and SP2 available and as always, it’s wise to update. You can use Patch Finder to check which version you are currently running – available at the bottom of this link.

I hope this post is helpful for somebody that is encountering the same issue..

*) You need MS SQL Standard or better to use Schemas with ArcSDE Geodatabase. MS SQL Express doesn’t support this with ArcSDE.

Tips & Tricks: Remote Desktop (Terminal) Services on Windows 7

This article describes how to setup the “Remote Desktop Services” – in the past also known as Terminal Services – on Windows 7 using the Microsoft Management Console.

First you need to install the following package:
Remote Server Administration Tools for Windows 7 with Service Pack 1 (SP1)

After installation, navigate to “Control Panel”-“Program and Features” and click on “Turn Windows features on or off”.

Enable “Remote Desktop Services Tools” under “Remote Server Administration Tools”-“Role Administration Tools”.

Role Administration Tools in 'Windows features'

Now you can access the Remote Desktop service through the Microsoft Management Console.

The Microsoft Management Console can be accessed by executing “mmc” in the “Start”-“Run” window.

Go to “File-Add/Remove Snap-in” and Add the “Remote Desktops” snap-in. Now save your MMC configuration settings to the Desktop or any other easy accessible location and your are set.

You can add as many Remote desktops as you want:

MMC screenshot

My experience is that you can get the most out of it by saving your credentials for each connection. This way you can easily connect with each machine and make switching from one machine to another look seamlessly easy and smooth, even when you didn’t log-in yet.

On certain machines saving of credentials is forbidden. You can change this by editing the Group Policies.

Start the Group Policy Editor by running “gpedit.msc”.
Navigate to “Computer Configuration”-“Administrative Templates”-“System”-“Credentials Delegation” and open “Allow Saved Credentials with NTLM-only Server Authentication”.

Enable the policy and click on the Show button to add the machines you want to enable saving of credentials for.

‘TERMSRV/*’ will allow it for any machine (through terminal services). But you can also specify a specific domain, for instance ‘TERMSRV/*.mydomain.com’.

Close the screens by clicking “Ok” and you are done!

Happy remote administrating!

Thanks to Alin Constantin for his blog post on how to enable saving of credentials for terminal services.

Tips & Tricks: Listening to Dependency Property change notifications of a given Element

Hi,

I want to share this great post from Anoop that shows a easy way to add a notification system to dependency properties of a given element. It creates and attaches a new property to the existing property and let’s you specify the PropertyChangedCallback eventhandler.

There are different examples on the internet, but i like how Anoop created a generic method with access to the callback event handler.

Here is the main part of the code:

        /// Listen for change of the dependency property
        public void RegisterForNotification(string propertyName, FrameworkElement element, PropertyChangedCallback callback)
        {
            //Bind to a depedency property
            Binding b = new Binding(propertyName) { Source = element };
            var prop = System.Windows.DependencyProperty.RegisterAttached(
                "ListenAttached"+propertyName,
                typeof(object),
                typeof(UserControl),
                new System.Windows.PropertyMetadata(callback));

            element.SetBinding(prop, b);
        }

And here is an example on how to use it:

//Shows a message box when the text of the Textbox changes.
RegisterForNotification
	("Text", this.txtMain,(d,e)=>MessageBox.Show("Text changed"));

Read Anoop’s complete article for more information!

update (07/28/2011):
here is small update of the code so it also works with other objects instead of just FrameworkElements

        private void RegisterForNotification(string propertyName, object source, PropertyChangedCallback callback)
        {
            Binding b = new Binding(propertyName);
            b.Source = source;

            DependencyProperty prop = System.Windows.DependencyProperty.RegisterAttached(
                "ListenAttached" + propertyName,
                typeof(object),
                this.GetType(),
                new System.Windows.PropertyMetadata(callback));

            BindingOperations.SetBinding(this, prop, b);
        }