Hresult: 0x80040228 the exception is solved by a group of friends and asked this question.
As follows:
Guangzhou-cangying (448362145) 16:48:41
An exception occurred when I used the above method to connect to the total.
I installed arcgis9.2,
I used the method you mentioned to connect, but there was an error message. Error message "error from hresult: 0x80040228"
My code is as follows:
Public iworkspace open_arcsde_workspace (string server, string instance, string user, string password, string database, string Version)
{
Try
{
ESRI. ArcGIS. esrisystem. ipropertyset propertyset = new ESRI. ArcGIS. esrisystem. propertysetclass ();
Propertyset. setproperty ("server", server );
Propertyset. setproperty ("instance", instance );
Propertyset. setproperty ("Database", database );
Propertyset. setproperty ("user", user );
Propertyset. setproperty ("password", password );
Propertyset. setproperty ("version", version );
Iworkspacefactory workspacefactory = new ESRI. ArcGIS. datasourcesgdb. sdeworkspacefactoryclass ();
Return workspacefactory. Open (propertyset, 0 );
}
Catch (exception ex)
{
Response. Write (ex. Message );
Return NULL;
}
}
Click the button to call the above functions in the event:
Open_arcsde_workspace ("nazirhasan", "esri_sde", "SDE", "Hasan", "", "SDE. Default ");
Host Name: nazirhasan
The SDE user is SDE
The SDE password is Hasan.
In fact, you only need to add a license control.
I hope you will not forget to add the license control when using simple programs in the future. Otherwise, you will not be able to find the problem for half a day.
From: http://bbs.esrichina-bj.cn/ESRI/viewthread.php? Tid = 14967