June 3, 2009 at 12:30 am
Hi all,
I'm building a package programmatically, but when i run the package i'm getting
Exception from HRESULT: 0xC0208035 this exception, i'm posting my code here plz go through and let me know where i'm going wrong
Package pkg = new Package();
pkg.Name = "MyCreatedPackage";
Application a = new Application();
IDTSComponentMetaData90 oledbSource;
IDTSComponentMetaData90 oledbDestination;
MainPipe dataFlow;
ConnectionManager conMgr = pkg.Connections.Add("OLEDB");
conMgr.Name = "OLEDBConnection";
conMgr.ConnectionString = "Data Source=1APWN0001;Initial Catalog=MediQM;User ID=mediqm";
TaskHost th = pkg.Executables.Add("DTS.Pipeline") as TaskHost;
th.Name = "DataFlow";
dataFlow = th.InnerObject as MainPipe;
oledbSource = dataFlow.ComponentMetaDataCollection.New();
oledbSource.ComponentClassID = "DTSAdapter.OLEDBSource";
oledbSource.Name = "OLEDBSource";
CManagedComponentWrapper instanceSource = oledbSource.Instantiate();
oledbSource.RuntimeConnectionCollection.New();
oledbSource.RuntimeConnectionCollection[0].ConnectionManagerID = pkg.Connections["OLEDBConnection"].ID;
oledbSource.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(pkg.Connections["OLEDBConnection"]);
instanceSource.ProvideComponentProperties();
instanceSource.SetComponentProperty("OpenRowset", "Temp_1");
instanceSource.SetComponentProperty("AccessMode", 0);
instanceSource.AcquireConnections(null); ////////////// HERE I'M GETTING THE Exception from HRESULT: 0xC0208035EXCEPTION
instanceSource.ReinitializeMetaData();
instanceSource.ReleaseConnections();
Thanks & regards
murali....
*He that is good with hammer tends to think every thing is a nail*
June 17, 2009 at 12:11 am
Hi guys,
i've solved the exception, the mistake was with the connection string format
the previous connection string was
"Provider=SQLNCLI10;Server=1DTWN0023;Database= AdventureWorks;Uid=sa; Pwd=sa@123; Trusted_Connection=yes;";
but the correct format is
"Data Source=(local);Initial Catalog=AdventureWorks;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False";
*He that is good with hammer tends to think every thing is a nail*
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply