This function will create the workspace using the Oracle provider
private void connect()
{
string cn = "Provider=OraOLEDB.Oracle.1;Password= ;Persist Security Info=True;UserID= ;DataSource=server:port/database"
IPropertySet pset = new PropertySetClass();
pset.SetProperty("CONNECTSTRING", cn);
IWorkspaceFactory fac = new OLEDBWorkspaceFactoryClass();
fac.Open(pset, 0);
} Don’t forget to initialize the license before you connect.
private void initLic()
{
RuntimeManager.Bind(ProductCode.Server);
IAoInitialize aoInit = new AoInitializeClass();
aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcServer);
}
Hope that was useful