Bulk Load from C#--Interop Problems
-
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
-
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
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