SQLXMLBULKLOAD in Visual Studio express

I am trying to perfom a bulk load of XML to sql in ASP.Net and stuck on a problem for some time now
The method I believe I should use is SQLXMLBULKLOAD as defined in http://support.microsoft.com/kb/316005 as this will allow me to map attributes and elements in the XML data to the SQL table using a mapping table.
To do this I need to import Interop.XBulkLoad4 and get  xblkld4.dll into the bin directory. However XBulkLoad4 cannot be loaded & I can't seem to load the dll.
How can I get SQLXMLBULKLOAD to work in Visual studio express I have SQL server 2008 installed.
assistance would be much appreciated
Simon CrippsOwnerAsked:
Who is Participating?
 
ZberteocConnect With a Mentor Commented:
Maybe this will help:

http://msdn.microsoft.com/en-us/library/aa257393(SQL.80).aspx

"In order to use the SQLXML Bulk Load COM object from a managed environment, you need to add a project reference to this object. This generates a managed wrapper interface around the Bulk Load COM object.

Note   The SQLXML Bulkload component will not run in a multi-threaded environment ('[MTAThread]' attribute). If you get an InvalidCastException exception with the additional information: QueryInterface for interface SQLXMLBULKLOADLib.ISQLXMLBulkLoad failed.", then you are running into this issue. The workaround is to make the object that contains the bulkload object be single-thread accessible (for example using the [STAThread] attribute as shown in the sample)."
0
 
ZberteocCommented:
You have to install SQLXML 4.0 SP1 pack from here:

http://www.microsoft.com/downloads/details.aspx?FamilyId=228DE03F-3B5A-428A-923F-58A033D316E1&displaylang=en

Go down the page until you see "Microsoft SQLXML 4.0 SP1". Download the package that applies for you and install it properly.


It says here: http://msdn.microsoft.com/en-us/library/ms171744.aspx

that is not installed by default with SQL 2008 Express.

0
 
Simon CrippsOwnerAuthor Commented:
I have downloaded Microsoft SQLXML 4.0 SP1 howeverthis does not get SQLXMLBULKLOAD to work nor recognise either "Imports SQLXMLBULKLOADLib" or "Imports Interop.XBulkLoad4".
From reading other comments I will need to get xblkld4.dll placed in the bin directory. This can apparently be done by using tlbimp.exe. I have searched all folders and cannot find the location of tlbimp.exe.
Could you assist further to get SQLXMLBULKLOAD  to work.
kind regards
0
 
Simon CrippsOwnerAuthor Commented:
Very useful many thanks
0
All Courses

From novice to tech pro — start learning today.