I am curious if anybody has tried to create a Catalogue Class in C#.
Here is the code:
CIODMLib.AdminI ndexServerClass oAdmin = new
CIODMLib.AdminI ndexServerClass ();
CIODMLib.CatAdm Class oCatAdmin;
oAdmin.MachineN ame = "MYSERVER";
if(oAdmin.IsRun ning())
{
oCatAdmin = (CIODMLib.CatAd mClass)oAdmin.G etCatalogByName ("MYDF");
//Error here
}
else
{
oAdmin.Start();
}
For some reason the runtime error message tells me that the cast is not
valid.
The modified code does not work either, the same exception "cast is not
valid":
CIODMLib.AdminI ndexServerClass oAdmin = new
CIODMLib.AdminI ndexServerClass ();
object oCatAdmin;
oAdmin.MachineN ame = "MYSERVER";
if(oAdmin.IsRun ning())
{
oCatAdmin = oAdmin.GetCatal ogByName("MYDF" );
MessageBox.Show (((CIODMLib.Cat AdmClass)oCatAd min).GetCatalog ByName("MYCATAL O
GUE"); //Error here
}
else
{
oAdmin.Start();
}
Anybody has any ideas how to deal with this?
Here is the code:
CIODMLib.AdminI ndexServerClass oAdmin = new
CIODMLib.AdminI ndexServerClass ();
CIODMLib.CatAdm Class oCatAdmin;
oAdmin.MachineN ame = "MYSERVER";
if(oAdmin.IsRun ning())
{
oCatAdmin = (CIODMLib.CatAd mClass)oAdmin.G etCatalogByName ("MYDF");
//Error here
}
else
{
oAdmin.Start();
}
For some reason the runtime error message tells me that the cast is not
valid.
The modified code does not work either, the same exception "cast is not
valid":
CIODMLib.AdminI ndexServerClass oAdmin = new
CIODMLib.AdminI ndexServerClass ();
object oCatAdmin;
oAdmin.MachineN ame = "MYSERVER";
if(oAdmin.IsRun ning())
{
oCatAdmin = oAdmin.GetCatal ogByName("MYDF" );
MessageBox.Show (((CIODMLib.Cat AdmClass)oCatAd min).GetCatalog ByName("MYCATAL O
GUE"); //Error here
}
else
{
oAdmin.Start();
}
Anybody has any ideas how to deal with this?
Comment