Home All Groups Group Topic Archive Search About

Return Value from SQLXMLBULKLOADLib.SQLXMLBulkLoad3Class.Execute

Author
14 Nov 2005 11:21 PM
LvBohemian
I am l trying to return a value of success or failure from the execute method
can anybody help?
Author
18 Nov 2005 5:46 AM
Bertan ARI [MSFT]
I am not sure if I understand what you want exactly. If you want to see if
Bulkload.Execute succedded, you need to try to catch the exception that
might be thrown by the execute. If there is exception, it means a failure..

Note that in .Net, preferred error reporting mechanism is using exceptions
rather than return codes.

--
Bertan ARI
This posting is provided "AS IS" with no warranties, and confers no rights.



Show quoteHide quote
"LvBohemian" <LvBohem***@discussions.microsoft.com> wrote in message
news:71CD4B7A-80D5-4E9F-B8F9-FF59BF64E2BD@microsoft.com...
>I am l trying to return a value of success or failure from the execute
>method
> can anybody help?
Are all your drivers up to date? click for free checkup

Author
19 Nov 2005 12:51 AM
LvBohemian
Return Value from SQLXMLBULKLOADLib.SQLXMLBulkLoad3Class.Execute

In ado.net I am used to getting the number of records affected by the
insert, update etc...

I already have verbose catches for the errors, but it would be nice to know
if it succeded or not even if there was not an error, I have found a number
of conditions where no error was raised and no bulk insert was performed...

thanks in advance.
Author
26 Nov 2005 5:12 PM
Colin Robinson
Iv found the same  it executed didnt hit the catch ex and didnt put any
rowsinto the db

in my case it was down to the autogenerated xml from
dataset.writexml.ignoreschema having a namespace attritute in the root
element Which ia am still struggling to remove ?


ie <dsData xmlns = ".....">
....
</dsData>


Colin




Show quoteHide quote
"LvBohemian" <LvBohem***@discussions.microsoft.com> wrote in message
news:E61C3FC8-3F7D-4672-B46A-399B0B541E32@microsoft.com...
> Return Value from SQLXMLBULKLOADLib.SQLXMLBulkLoad3Class.Execute
>
> In ado.net I am used to getting the number of records affected by the
> insert, update etc...
>
> I already have verbose catches for the errors, but it would be nice to
> know
> if it succeded or not even if there was not an error, I have found a
> number
> of conditions where no error was raised and no bulk insert was
> performed...
>
> thanks in advance.
Author
26 Nov 2005 5:48 PM
LvBohemian
here is the functioning format I am using, that uses the northwind db...

<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes"
xmlns:sql="urn:schemas-microsoft-com:xml-sql">

<ElementType name="Shipper" sql:relation="Shippers">
<AttributeType name="ShipperID" required="yes" dt:type="int"/>
<AttributeType name="CompanyName" required="yes" dt:type="string"/>
<AttributeType name="Phone" required="no" dt:type="string"/>

<attribute type="ShipperID"/>
<attribute type="CompanyName"/>
<attribute type="Phone"/>
</ElementType>
</Schema>
Author
26 Nov 2005 8:56 PM
Colin Robinson
Looks like the prob is the block:

<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes"
xmlns:sql="urn:schemas-microsoft-com:xml-sql">

Anyone care to explain this ?

my xsd is actually being generated from visual studio 2005
dataset.writeschema !  is this compatible with sqlxml3.0BulkLoad com object
?
Author
27 Nov 2005 1:45 AM
LvBohemian
my functioning sample in my previous post is an XDR not a XSD
Author
27 Nov 2005 1:48 AM
LvBohemian
besides being an XDR, my schema is passed as a static parameter that I use
with my bulk inserts, my various XDR's sit on a network share.

Bookmark and Share