Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. creating ssis package using C#.net

creating ssis package using C#.net

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasesql-servercomsecurity
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    l laxmikant
    wrote on last edited by
    #1

    Hi friends I have created a package using C#.net myPackage.PackageType = DTSPackageType.DTSDesigner90; myPackage.Name = "MySSISPackage"; myPackage.Description = "Created using the SSIS API"; myPackage.CreatorComputerName = System.Environment.MachineName; myPackage.CreatorName = "Otey"; //Add the OLE DB and Flat File Connection Managers Console.WriteLine("Creating the MyOLEDBConnection"); cnOLEDB = myPackage.Connections.Add("OLEDB"); cnOLEDB.Name = "MyOLEDBConnection"; cnOLEDB.ConnectionString = "Data Source=RELL;Initial Catalog=Northwind;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;"; //cnOLEDB.ProtectionLevel = DTSProtectionLevel.EncryptAllWithPassword; Console.WriteLine("Creating the MyFlatFileConnection"); cnDestination = myPackage.Connections.Add("OLEDB"); cnDestination.Name = "cnDestination"; cnDestination.ConnectionString = "Data Source=RELL;Initial Catalog=testssis;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;"; Console.WriteLine("Adding a Data Flow Task"); TaskHost taskDF = myPackage.Executables.Add("DTS.Pipeline") as TaskHost; taskDF.Name = "DataFlow"; DTP = default(MainPipe); DTP = taskDF.InnerObject as MainPipe; // Add the OLE DB Source Console.WriteLine("Adding an OLEDB Source"); DFSource = default(IDTSComponentMetaData90); DFSource = DTP.ComponentMetaDataCollection.New(); DFSource.ComponentClassID = "DTSAdapter.OLEDBSource"; DFSource.Name = "OLEDBSource"; CManagedComponentWrapper SourceInst = DFSource.Instantiate(); SourceInst.ProvideComponentProperties(); DFSource.RuntimeConnectionCollection[0].ConnectionManagerID = myPackage.Connections["MyOLEDBConnection"].ID; DFSource.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(myPackage.Connections["MyOLEDBConnection"]); SourceInst.SetComponentProperty("OpenRowset", "Categories"); SourceInst.SetComponentProperty("AccessMode", 2); SourceInst.AcquireConnections(null); SourceInst.ReinitializeMetaData(); // Error line SourceInst.ReleaseConnections(); I am getting an exception "Exception from HRESULT:

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups