I am trying to use xml bulk load in a .net environment using vb.net.
The first issue I ran into was not being able to do a bulk load in a
multi-threaded environment. So I now have initiated a new thread prior
to trying to execute the bulk load. I am consistenly getting an unable
to connect to data source error. Does anyone have any ideas as to what
I may be doing incorrectly? The connection string is the same one I
use in other places without any issues.
Private Sub BulkLoadXML()
Dim bulkload As New Thread(New ThreadStart(AddressOf
ExecuteBulkCall))
bulkload.ApartmentState = ApartmentState.STA
bulkload.Start()
bulkload.Join()
End Sub
Private Sub ExecuteBulkCall()
Dim _bulkInstance As New SQLXMLBulkLoad3Class
_bulkInstance.ConnectionString = _strConn
_bulkInstance.ErrorLogFile = "c:\temp\xmlerror.log"
_bulkInstance.KeepIdentity = False
_bulkInstance.Execute("c:\SampleSchema.xsd",
"c:\SampleXMLData.xml")
End Sub
franksag
Posted via http://www.codecomments.com
What does the connection string look like? When you say it worked in other
places - what places are those?
Andrew Conrad
Microsoft Corp
Wednesday, March 7, 2012
Error connecting to datasource using bulk load
Labels:
bulk,
connecting,
database,
datasource,
environment,
error,
load,
microsoft,
mysql,
net,
oracle,
ran,
server,
sql,
xml
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment