Getting Problem In AcquireConnections
Aug 27, 2007
Hi All,
I just started looking at the SSIS programming, wanted to created a package having table to table data transfer. My source and destination databases are in Oracle.
I gone throught the code samples and started creating the source component. And the whatever samples i've seen the code i have written (copied) looks correct to me but still getting following error.
The basic questions i have is,
1. Do i need to setup something to start programming in SSIS. I am using 'Microsoft Visual C# Express Edition' for programming.
I have all the dll's in place.
And after compiling the code the exception i got is,
{"Exception from HRESULT: 0xC020801C"} System.Runtime.InteropServices.COMException was caught
Message="Exception from HRESULT: 0xC020801C"
Source="Microsoft.SqlServer.DTSPipelineWrap"
ErrorCode=-1071611876
StackTrace:
at Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass.AcquireConnections(Object pTransaction)
The Code is as Follows:
public static void CreateSource()
{
Microsoft.SqlServer.Dts.Runtime.Package package = new Microsoft.SqlServer.Dts.Runtime.Package();
Executable e = package.Executables.Add("DTS.Pipeline.1");
Microsoft.SqlServer.Dts.Runtime.TaskHost thMainPipe = e as Microsoft.SqlServer.Dts.Runtime.TaskHost;
MainPipe dataFlow = thMainPipe.InnerObject as MainPipe;
// Add an OLEDB connection manager that is used by the component to the package.
ConnectionManager cm = package.Connections.Add("OLEDB");
cm.Name = "OLEDB ConnectionManager";
cm.ConnectionString = @"Data Source=pqdb9i;User ID=srcDbUserId;Provider=MSDAORA.1;Persist Security Info=False;Integrated Security=SSPI;Auto Translate=False;";
package.DelayValidation = true;
cm.DelayValidation = true;
component = dataFlow.ComponentMetaDataCollection.New();
component.Name = "OLEDBSource";
component.ComponentClassID = "DTSAdapter.OleDbSource.1";
// Get the design time instance of the component.
CManagedComponentWrapper instance = component.Instantiate();
// Initialize the component
instance.ProvideComponentProperties();
// Specify the connection manager.
if (component.RuntimeConnectionCollection.Count > 0)
{
component.RuntimeConnectionCollection[0].ConnectionManagerID = package.Connections[0].ID;
component.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(package.Connections[0]);
}
// Set the custom properties.
//instance.SetComponentProperty("AlwaysUseDefaultCodePage", false);
instance.SetComponentProperty("AccessMode", 2);
instance.SetComponentProperty("SqlCommand", "Select * from srcTable");
// Reinitialize the metadata.
try
{
instance.AcquireConnections(null);
instance.ReinitializeMetaData();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Console.WriteLine(component.InputCollection.Count);
}
///End Code
Thanks in advance
-Yuwaraj
View 1 Replies
Feb 17, 2008
Hello,
I am trying to programatically create an SQL Server destination in SSIS. I am creating the connection string, then initiating a connection, and then call AcquireConnections(nothing).
When running in debug mode or in command line, all works perfect. However, when running from within a Windows Service, I get the following exception:
System.Runtime.InteropServices.COMException (0xC020801C): Exception from HRESULT: 0xC020801C at Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass.AcquireConnections(Object pTransaction) at ...
Any ideas ?
Thanks,
Hanan.
View 1 Replies
View Related
Sep 3, 2007
Hi, I have a windows service which is configured to login under the "local System Account". and the windows service is actually creating a SSIS package and running it. however, it was running good with out any problem. but we had to uninstall and again reinstall the windows service and after that it is generating an error "Exception from HRESULT: 0xC020801C" when ever it is invoking the
Instance.AcquireConnections(null);
The connection string that is given for the connection manager is as follows
Data Source=ORIONOFFICESERVERS;Initial Catalog=CDBDBase;Integrated Security=SSPI;User Id=;Password=;Provider=SQLNCLI.1;Auto translate=false"
What is the wrong here-can any body kindly suggest? I have tried with the following too
Data Source=ORIONOFFICESERVERS;Initial Catalog=CDBDBase;Integrated Security=SSPI;Provider=SQLNCLI.1;Auto translate=false"
Does SSIS need to have a connection string with SSPI always? is there any way to use a sql authenlication for this purpose? like using sql user name and password in connection string? Please suggest me. I need it badly.
View 7 Replies
View Related
Oct 21, 2005
I'm working on developing a C# application using an SSIS package. I'm using the code example from BOL: "Adding and Configuring a Component". When I run the sample I get the above error. This could be one of several things, including:
View 7 Replies
View Related
May 16, 2007
Hello Every one,
here to food for SSIS gurus,
I am preparing SSIS package programmetically using C#, in a web wethod, to perform fuzzy lookup and other transformations in to sql server data.
now situaltion is like this,
there are three system (independent m/cs)
m/c 1 :- webserver
m/c 2 :- sql database (sqlserver)
m/c 3 :- client (it can be any where , we are using onc click deplyment)
Now case is like this.
A user sitting at m/c no. 3 (a thin client) has one-click-deployed application, clicks the button "Create SSIS Package" , which sends this message to webserver (i.e. m/c 2 ) where C# code constructs the package programmatically,
there are three component inside package
1. oldedb Source (a sql server table -- sqlserver is at m/c no 3)
2. fuzzylookup component
3. oledb destination (a sql server table -- sqlserver is at m/c no 3)
Now 1 and 3 component of the package need to connect to sqlserver for initialization there metadata from actual tables.
here is code :
public IDTSComponentMetaData90 oledbDest = null;
oledbDest = dataFlowTask.ComponentMetaDataCollection.New();
oledbDest.Name = "Destination";
oledbDest.ComponentClassID = "DTSAdapter.OLEDBDestination.1";
CManagedComponentWrapper srcDesignTime = oledbDest.Instantiate();
srcDesignTime.ProvideComponentProperties();
oledbDest.RuntimeConnectionCollection[0].ConnectionManagerID = package.Connections[connName].ID;
oledbDest.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(package.Connections[connName]);
srcDesignTime.SetComponentProperty("AccessMode",0);
srcDesignTime.SetComponentProperty("OpenRowset",tableName);
// Tries to connect to sqlserver hosted at different m/c
srcDesignTime.AcquireConnections(null);
srcDesignTime.ReinitializeMetaData();
srcDesignTime.ReleaseConnections();
now the 3rd last line which says srcDesignTime.AcquireConnections(null);
tries to open the connection to the selserver (in order to get information abt actual table and its columns) which is installed at another m/c, and this is possible cause of error (i think !!)
there are two cases in one case i am getting an error and in second case it is working just fine..
case 1. If i use (local webservice) web service to create package it works.
case 2 if i use published (on local IIS ) webservice to create package, It fails (at the code srcDesignTime.AcquireConnections(null); )
so i think problem is related to some authorization, may be i am wrong !!1
Please help me.
thanks in advance
Pradeep
(I am really looking for a reply for MR. Jamie Thomson )
View 3 Replies
View Related