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. General Programming
  3. C#
  4. Bulk Load from C#--Interop Problems

Bulk Load from C#--Interop Problems

Scheduled Pinned Locked Moved C#
csharpcomxmlhelpquestion
2 Posts 2 Posters 1 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.
  • P Offline
    P Offline
    perlmunger
    wrote on last edited by
    #1

    I am getting this error message when I try to bulk load some data from an XML file: QueryInterface for interface Interop.SQLXMLBULKLOADLib.ISQLXMLBulkLoad failed. Here is my C# code that calls my interop assembly:

    [STAThread]
    public void BulkLoad( string schemaFilePath, string file, string identifier )
    {
    Interop.SQLXMLBULKLOADLib.ISQLXMLBulkLoad bulkLoader = new Interop.SQLXMLBULKLOADLib.SQLXMLBulkLoad3Class();
    bulkLoader.ConnectionString = connectionString;
    bulkLoader.ErrorLogFile = GetParameter( "TempDirectory" ) + @"\" + identifier + ".error.log";
    bulkLoader.TempFilePath = GetParameter( "TempDirectory" );
    bulkLoader.Transaction = true;
    bulkLoader.CheckConstraints= false;
    bulkLoader.XMLFragment = true;
    bulkLoader.SchemaGen = true;
    bulkLoader.IgnoreDuplicateKeys = false;

    bulkLoader.Execute( schemaFilePath, file );
    
    bulkLoader = null;
    

    }

    Any ideas? Thanks. -Matt ------------------------------------------ The 3 great virtues of a programmer: Laziness, Impatience, and Hubris. --Larry Wall

    N 1 Reply Last reply
    0
    • P perlmunger

      I am getting this error message when I try to bulk load some data from an XML file: QueryInterface for interface Interop.SQLXMLBULKLOADLib.ISQLXMLBulkLoad failed. Here is my C# code that calls my interop assembly:

      [STAThread]
      public void BulkLoad( string schemaFilePath, string file, string identifier )
      {
      Interop.SQLXMLBULKLOADLib.ISQLXMLBulkLoad bulkLoader = new Interop.SQLXMLBULKLOADLib.SQLXMLBulkLoad3Class();
      bulkLoader.ConnectionString = connectionString;
      bulkLoader.ErrorLogFile = GetParameter( "TempDirectory" ) + @"\" + identifier + ".error.log";
      bulkLoader.TempFilePath = GetParameter( "TempDirectory" );
      bulkLoader.Transaction = true;
      bulkLoader.CheckConstraints= false;
      bulkLoader.XMLFragment = true;
      bulkLoader.SchemaGen = true;
      bulkLoader.IgnoreDuplicateKeys = false;

      bulkLoader.Execute( schemaFilePath, file );
      
      bulkLoader = null;
      

      }

      Any ideas? Thanks. -Matt ------------------------------------------ The 3 great virtues of a programmer: Laziness, Impatience, and Hubris. --Larry Wall

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      perlmunger wrote: QueryInterface for interface Interop.SQLXMLBULKLOADLib.ISQLXMLBulkLoad failed. This means that it was unable to return an interface pointer from a specific class (coclass really in MIDL terms). You should make sure that the COM component is registered on the machine your attempting to create it on and that the class itself implements the interface you are requesting. - Nick Parker
      My Blog | My Articles

      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