PC Review


Reply
Thread Tools Rate Thread

ADO.NET Transaction

 
 
Lit
Guest
Posts: n/a
 
      8th Aug 2007
Hello,

using ADO.NET 2.0, VS.NET 2005, SQL2005
I need to execute several Stored Procedures under one transaction. Can I
use just one transaction or have to use multiple ( then commit or rollback
all )
How does it work with ADO.NET

Ado.Tran
SP1 Called
loop
SP2 Called
SP3 Called
loop
SP4 Called
loop
Sp5 Called
Etc... etc...

if any error
rollback transaction ( or all transactions )
else
committe Transaction ( or all Transactions )

Thanks for any help or other Ideas

Lit




 
Reply With Quote
 
 
 
 
William Vaughn
Guest
Posts: n/a
 
      9th Aug 2007
If it were me I would probably call a stored procedure that started the
transaction ran all of the SPs, handled the exceptions, channeled the logic
and returned success or failure via RETURN... but that's just me. I'm not a
fan of client-side transactions...

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

"Lit" <(E-Mail Removed)> wrote in message
news:e0$(E-Mail Removed)...
> Hello,
>
> using ADO.NET 2.0, VS.NET 2005, SQL2005
> I need to execute several Stored Procedures under one transaction. Can I
> use just one transaction or have to use multiple ( then commit or rollback
> all )
> How does it work with ADO.NET
>
> Ado.Tran
> SP1 Called
> loop
> SP2 Called
> SP3 Called
> loop
> SP4 Called
> loop
> Sp5 Called
> Etc... etc...
>
> if any error
> rollback transaction ( or all transactions )
> else
> committe Transaction ( or all Transactions )
>
> Thanks for any help or other Ideas
>
> Lit
>
>
>
>


 
Reply With Quote
 
Frans Bouma [C# MVP]
Guest
Posts: n/a
 
      9th Aug 2007
Lit wrote:

> Hello,
>
> using ADO.NET 2.0, VS.NET 2005, SQL2005
> I need to execute several Stored Procedures under one transaction.
> Can I use just one transaction or have to use multiple ( then commit
> or rollback all ) How does it work with ADO.NET
>
> Ado.Tran
> SP1 Called
> loop
> SP2 Called
> SP3 Called
> loop
> SP4 Called
> loop
> Sp5 Called
> Etc... etc...
>
> if any error
> rollback transaction ( or all transactions )
> else
> committe Transaction ( or all Transactions )
>
> Thanks for any help or other Ideas


sql2005 doesn't support nested local transactions anyway, so you will
run 1 transaction no matter what.

first start a connection, then create a transaction from that
connection, then call all procs, then commit the transaction and if an
error occured, rollback the transaction, then close the connection and
dispose the transaction.

If you want to roll back parts of the transaction, for example if an
error in SP2 occurs, you want to rollback all work done by SP2, use
Save points of the transaction (SqlTransaction.Save ), which you can
use to rollback to (use a nested try/catch)

FB


--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
Reply With Quote
 
Lit
Guest
Posts: n/a
 
      9th Aug 2007
William,

What about when you have to process and send lists?
I know I can send XML to SQL
Is it always a bad reason to do client transactions?
Can you tell me more about your "bad" experience of client transactions I am
all ears.
I would love to hear some good or bad stories so I can decide what to do.

Thank you,

Lit



"William Vaughn" <(E-Mail Removed)> wrote in message
news:O%(E-Mail Removed)...
> If it were me I would probably call a stored procedure that started the
> transaction ran all of the SPs, handled the exceptions, channeled the
> logic and returned success or failure via RETURN... but that's just me.
> I'm not a fan of client-side transactions...
>
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant, Dad, Grandpa
> Microsoft MVP
> INETA Speaker
> www.betav.com
> www.betav.com/blog/billva
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> __________________________________
> Visit www.hitchhikerguides.net to get more information on my latest book:
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
> -----------------------------------------------------------------------------------------------------------------------
>
> "Lit" <(E-Mail Removed)> wrote in message
> news:e0$(E-Mail Removed)...
>> Hello,
>>
>> using ADO.NET 2.0, VS.NET 2005, SQL2005
>> I need to execute several Stored Procedures under one transaction. Can I
>> use just one transaction or have to use multiple ( then commit or
>> rollback all )
>> How does it work with ADO.NET
>>
>> Ado.Tran
>> SP1 Called
>> loop
>> SP2 Called
>> SP3 Called
>> loop
>> SP4 Called
>> loop
>> Sp5 Called
>> Etc... etc...
>>
>> if any error
>> rollback transaction ( or all transactions )
>> else
>> committe Transaction ( or all Transactions )
>>
>> Thanks for any help or other Ideas
>>
>> Lit
>>
>>
>>
>>

>



 
Reply With Quote
 
William Vaughn
Guest
Posts: n/a
 
      9th Aug 2007
Ah, I don't have the time and you don't have the patience to wait until I
do...
Nothing is ever "always bad" just as nothing is "always good". XML has its
place. It's just been misused by too many that should know better.
Client transactions put too much schema-dependent, business-rule-dependant
code on the client. I think more logic should be run from a common platform.
I discuss these issues in most of my books--even the latest. See Chapter 1
that discusses architectures...

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

"Lit" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> William,
>
> What about when you have to process and send lists?
> I know I can send XML to SQL
> Is it always a bad reason to do client transactions?
> Can you tell me more about your "bad" experience of client transactions I
> am all ears.
> I would love to hear some good or bad stories so I can decide what to do.
>
> Thank you,
>
> Lit
>
>
>
> "William Vaughn" <(E-Mail Removed)> wrote in message
> news:O%(E-Mail Removed)...
>> If it were me I would probably call a stored procedure that started the
>> transaction ran all of the SPs, handled the exceptions, channeled the
>> logic and returned success or failure via RETURN... but that's just me.
>> I'm not a fan of client-side transactions...
>>
>> --
>> ____________________________________
>> William (Bill) Vaughn
>> Author, Mentor, Consultant, Dad, Grandpa
>> Microsoft MVP
>> INETA Speaker
>> www.betav.com
>> www.betav.com/blog/billva
>> Please reply only to the newsgroup so that others can benefit.
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> __________________________________
>> Visit www.hitchhikerguides.net to get more information on my latest book:
>> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
>> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
>> -----------------------------------------------------------------------------------------------------------------------
>>
>> "Lit" <(E-Mail Removed)> wrote in message
>> news:e0$(E-Mail Removed)...
>>> Hello,
>>>
>>> using ADO.NET 2.0, VS.NET 2005, SQL2005
>>> I need to execute several Stored Procedures under one transaction. Can
>>> I use just one transaction or have to use multiple ( then commit or
>>> rollback all )
>>> How does it work with ADO.NET
>>>
>>> Ado.Tran
>>> SP1 Called
>>> loop
>>> SP2 Called
>>> SP3 Called
>>> loop
>>> SP4 Called
>>> loop
>>> Sp5 Called
>>> Etc... etc...
>>>
>>> if any error
>>> rollback transaction ( or all transactions )
>>> else
>>> committe Transaction ( or all Transactions )
>>>
>>> Thanks for any help or other Ideas
>>>
>>> Lit
>>>
>>>
>>>
>>>

>>

>
>


 
Reply With Quote
 
Lit
Guest
Posts: n/a
 
      9th Aug 2007
William,

You are right about "always", What is the name of your latest book?

Thank you,

Lit

"William Vaughn" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Ah, I don't have the time and you don't have the patience to wait until I
> do...
> Nothing is ever "always bad" just as nothing is "always good". XML has its
> place. It's just been misused by too many that should know better.
> Client transactions put too much schema-dependent, business-rule-dependant
> code on the client. I think more logic should be run from a common
> platform.
> I discuss these issues in most of my books--even the latest. See Chapter 1
> that discusses architectures...
>
> hth
>
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant, Dad, Grandpa
> Microsoft MVP
> INETA Speaker
> www.betav.com
> www.betav.com/blog/billva
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> __________________________________
> Visit www.hitchhikerguides.net to get more information on my latest book:
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
> -----------------------------------------------------------------------------------------------------------------------
>
> "Lit" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> William,
>>
>> What about when you have to process and send lists?
>> I know I can send XML to SQL
>> Is it always a bad reason to do client transactions?
>> Can you tell me more about your "bad" experience of client transactions I
>> am all ears.
>> I would love to hear some good or bad stories so I can decide what to do.
>>
>> Thank you,
>>
>> Lit
>>
>>
>>
>> "William Vaughn" <(E-Mail Removed)> wrote in message
>> news:O%(E-Mail Removed)...
>>> If it were me I would probably call a stored procedure that started the
>>> transaction ran all of the SPs, handled the exceptions, channeled the
>>> logic and returned success or failure via RETURN... but that's just me.
>>> I'm not a fan of client-side transactions...
>>>
>>> --
>>> ____________________________________
>>> William (Bill) Vaughn
>>> Author, Mentor, Consultant, Dad, Grandpa
>>> Microsoft MVP
>>> INETA Speaker
>>> www.betav.com
>>> www.betav.com/blog/billva
>>> Please reply only to the newsgroup so that others can benefit.
>>> This posting is provided "AS IS" with no warranties, and confers no
>>> rights.
>>> __________________________________
>>> Visit www.hitchhikerguides.net to get more information on my latest
>>> book:
>>> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
>>> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
>>> -----------------------------------------------------------------------------------------------------------------------
>>>
>>> "Lit" <(E-Mail Removed)> wrote in message
>>> news:e0$(E-Mail Removed)...
>>>> Hello,
>>>>
>>>> using ADO.NET 2.0, VS.NET 2005, SQL2005
>>>> I need to execute several Stored Procedures under one transaction. Can
>>>> I use just one transaction or have to use multiple ( then commit or
>>>> rollback all )
>>>> How does it work with ADO.NET
>>>>
>>>> Ado.Tran
>>>> SP1 Called
>>>> loop
>>>> SP2 Called
>>>> SP3 Called
>>>> loop
>>>> SP4 Called
>>>> loop
>>>> Sp5 Called
>>>> Etc... etc...
>>>>
>>>> if any error
>>>> rollback transaction ( or all transactions )
>>>> else
>>>> committe Transaction ( or all Transactions )
>>>>
>>>> Thanks for any help or other Ideas
>>>>
>>>> Lit
>>>>
>>>>
>>>>
>>>>
>>>

>>
>>

>



 
Reply With Quote
 
William Vaughn
Guest
Posts: n/a
 
      9th Aug 2007
"Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)" (Addison
Wesley).
I hope it helps.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

"Lit" <(E-Mail Removed)> wrote in message
news:Oqz%(E-Mail Removed)...
> William,
>
> You are right about "always", What is the name of your latest book?
>
> Thank you,
>
> Lit
>
> "William Vaughn" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Ah, I don't have the time and you don't have the patience to wait until I
>> do...
>> Nothing is ever "always bad" just as nothing is "always good". XML has
>> its place. It's just been misused by too many that should know better.
>> Client transactions put too much schema-dependent,
>> business-rule-dependant code on the client. I think more logic should be
>> run from a common platform.
>> I discuss these issues in most of my books--even the latest. See Chapter
>> 1 that discusses architectures...
>>
>> hth
>>
>> --
>> ____________________________________
>> William (Bill) Vaughn
>> Author, Mentor, Consultant, Dad, Grandpa
>> Microsoft MVP
>> INETA Speaker
>> www.betav.com
>> www.betav.com/blog/billva
>> Please reply only to the newsgroup so that others can benefit.
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> __________________________________
>> Visit www.hitchhikerguides.net to get more information on my latest book:
>> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
>> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
>> -----------------------------------------------------------------------------------------------------------------------
>>
>> "Lit" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> William,
>>>
>>> What about when you have to process and send lists?
>>> I know I can send XML to SQL
>>> Is it always a bad reason to do client transactions?
>>> Can you tell me more about your "bad" experience of client transactions
>>> I am all ears.
>>> I would love to hear some good or bad stories so I can decide what to
>>> do.
>>>
>>> Thank you,
>>>
>>> Lit
>>>
>>>
>>>
>>> "William Vaughn" <(E-Mail Removed)> wrote in message
>>> news:O%(E-Mail Removed)...
>>>> If it were me I would probably call a stored procedure that started the
>>>> transaction ran all of the SPs, handled the exceptions, channeled the
>>>> logic and returned success or failure via RETURN... but that's just me.
>>>> I'm not a fan of client-side transactions...
>>>>
>>>> --
>>>> ____________________________________
>>>> William (Bill) Vaughn
>>>> Author, Mentor, Consultant, Dad, Grandpa
>>>> Microsoft MVP
>>>> INETA Speaker
>>>> www.betav.com
>>>> www.betav.com/blog/billva
>>>> Please reply only to the newsgroup so that others can benefit.
>>>> This posting is provided "AS IS" with no warranties, and confers no
>>>> rights.
>>>> __________________________________
>>>> Visit www.hitchhikerguides.net to get more information on my latest
>>>> book:
>>>> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
>>>> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
>>>> -----------------------------------------------------------------------------------------------------------------------
>>>>
>>>> "Lit" <(E-Mail Removed)> wrote in message
>>>> news:e0$(E-Mail Removed)...
>>>>> Hello,
>>>>>
>>>>> using ADO.NET 2.0, VS.NET 2005, SQL2005
>>>>> I need to execute several Stored Procedures under one transaction.
>>>>> Can I use just one transaction or have to use multiple ( then commit
>>>>> or rollback all )
>>>>> How does it work with ADO.NET
>>>>>
>>>>> Ado.Tran
>>>>> SP1 Called
>>>>> loop
>>>>> SP2 Called
>>>>> SP3 Called
>>>>> loop
>>>>> SP4 Called
>>>>> loop
>>>>> Sp5 Called
>>>>> Etc... etc...
>>>>>
>>>>> if any error
>>>>> rollback transaction ( or all transactions )
>>>>> else
>>>>> committe Transaction ( or all Transactions )
>>>>>
>>>>> Thanks for any help or other Ideas
>>>>>
>>>>> Lit
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>

>>

>
>


 
Reply With Quote
 
Lit
Guest
Posts: n/a
 
      9th Aug 2007
William,

This is NOT going to help me right now, it may in the future?
I am under time constraint to get things going.
I was only looking for some good pattern or guidelines to what would be best
to send large lists to SQL2005 via ADO.NET 2.0 ( Max of 3000 rows )

Thank You,

Lit

"William Vaughn" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)"
> (Addison Wesley).
> I hope it helps.
>
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant, Dad, Grandpa
> Microsoft MVP
> INETA Speaker
> www.betav.com
> www.betav.com/blog/billva
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> __________________________________
> Visit www.hitchhikerguides.net to get more information on my latest book:
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
> -----------------------------------------------------------------------------------------------------------------------
>
> "Lit" <(E-Mail Removed)> wrote in message
> news:Oqz%(E-Mail Removed)...
>> William,
>>
>> You are right about "always", What is the name of your latest book?
>>
>> Thank you,
>>
>> Lit
>>
>> "William Vaughn" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Ah, I don't have the time and you don't have the patience to wait until
>>> I do...
>>> Nothing is ever "always bad" just as nothing is "always good". XML has
>>> its place. It's just been misused by too many that should know better.
>>> Client transactions put too much schema-dependent,
>>> business-rule-dependant code on the client. I think more logic should be
>>> run from a common platform.
>>> I discuss these issues in most of my books--even the latest. See Chapter
>>> 1 that discusses architectures...
>>>
>>> hth
>>>
>>> --
>>> ____________________________________
>>> William (Bill) Vaughn
>>> Author, Mentor, Consultant, Dad, Grandpa
>>> Microsoft MVP
>>> INETA Speaker
>>> www.betav.com
>>> www.betav.com/blog/billva
>>> Please reply only to the newsgroup so that others can benefit.
>>> This posting is provided "AS IS" with no warranties, and confers no
>>> rights.
>>> __________________________________
>>> Visit www.hitchhikerguides.net to get more information on my latest
>>> book:
>>> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
>>> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
>>> -----------------------------------------------------------------------------------------------------------------------
>>>
>>> "Lit" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> William,
>>>>
>>>> What about when you have to process and send lists?
>>>> I know I can send XML to SQL
>>>> Is it always a bad reason to do client transactions?
>>>> Can you tell me more about your "bad" experience of client transactions
>>>> I am all ears.
>>>> I would love to hear some good or bad stories so I can decide what to
>>>> do.
>>>>
>>>> Thank you,
>>>>
>>>> Lit
>>>>
>>>>
>>>>
>>>> "William Vaughn" <(E-Mail Removed)> wrote in message
>>>> news:O%(E-Mail Removed)...
>>>>> If it were me I would probably call a stored procedure that started
>>>>> the transaction ran all of the SPs, handled the exceptions, channeled
>>>>> the logic and returned success or failure via RETURN... but that's
>>>>> just me. I'm not a fan of client-side transactions...
>>>>>
>>>>> --
>>>>> ____________________________________
>>>>> William (Bill) Vaughn
>>>>> Author, Mentor, Consultant, Dad, Grandpa
>>>>> Microsoft MVP
>>>>> INETA Speaker
>>>>> www.betav.com
>>>>> www.betav.com/blog/billva
>>>>> Please reply only to the newsgroup so that others can benefit.
>>>>> This posting is provided "AS IS" with no warranties, and confers no
>>>>> rights.
>>>>> __________________________________
>>>>> Visit www.hitchhikerguides.net to get more information on my latest
>>>>> book:
>>>>> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
>>>>> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
>>>>> -----------------------------------------------------------------------------------------------------------------------
>>>>>
>>>>> "Lit" <(E-Mail Removed)> wrote in message
>>>>> news:e0$(E-Mail Removed)...
>>>>>> Hello,
>>>>>>
>>>>>> using ADO.NET 2.0, VS.NET 2005, SQL2005
>>>>>> I need to execute several Stored Procedures under one transaction.
>>>>>> Can I use just one transaction or have to use multiple ( then commit
>>>>>> or rollback all )
>>>>>> How does it work with ADO.NET
>>>>>>
>>>>>> Ado.Tran
>>>>>> SP1 Called
>>>>>> loop
>>>>>> SP2 Called
>>>>>> SP3 Called
>>>>>> loop
>>>>>> SP4 Called
>>>>>> loop
>>>>>> Sp5 Called
>>>>>> Etc... etc...
>>>>>>
>>>>>> if any error
>>>>>> rollback transaction ( or all transactions )
>>>>>> else
>>>>>> committe Transaction ( or all Transactions )
>>>>>>
>>>>>> Thanks for any help or other Ideas
>>>>>>
>>>>>> Lit
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>

>>
>>

>



 
Reply With Quote
 
William Vaughn
Guest
Posts: n/a
 
      9th Aug 2007
Okay, there is no good way to use ADO.NET query classes to do bulk uploads.
There are other ways however. The SqlBulkCopy class can take anything you
can expose with a DataReader (DataTable to DataReader is supported in 2.0)
and send it to SQL Server in a single high-speed operation.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

"Lit" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> William,
>
> This is NOT going to help me right now, it may in the future?
> I am under time constraint to get things going.
> I was only looking for some good pattern or guidelines to what would be
> best to send large lists to SQL2005 via ADO.NET 2.0 ( Max of 3000 rows )
>
> Thank You,
>
> Lit
>
> "William Vaughn" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> "Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)"
>> (Addison Wesley).
>> I hope it helps.
>>
>> --
>> ____________________________________
>> William (Bill) Vaughn
>> Author, Mentor, Consultant, Dad, Grandpa
>> Microsoft MVP
>> INETA Speaker
>> www.betav.com
>> www.betav.com/blog/billva
>> Please reply only to the newsgroup so that others can benefit.
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> __________________________________
>> Visit www.hitchhikerguides.net to get more information on my latest book:
>> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
>> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
>> -----------------------------------------------------------------------------------------------------------------------
>>
>> "Lit" <(E-Mail Removed)> wrote in message
>> news:Oqz%(E-Mail Removed)...
>>> William,
>>>
>>> You are right about "always", What is the name of your latest book?
>>>
>>> Thank you,
>>>
>>> Lit
>>>
>>> "William Vaughn" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> Ah, I don't have the time and you don't have the patience to wait until
>>>> I do...
>>>> Nothing is ever "always bad" just as nothing is "always good". XML has
>>>> its place. It's just been misused by too many that should know better.
>>>> Client transactions put too much schema-dependent,
>>>> business-rule-dependant code on the client. I think more logic should
>>>> be run from a common platform.
>>>> I discuss these issues in most of my books--even the latest. See
>>>> Chapter 1 that discusses architectures...
>>>>
>>>> hth
>>>>
>>>> --
>>>> ____________________________________
>>>> William (Bill) Vaughn
>>>> Author, Mentor, Consultant, Dad, Grandpa
>>>> Microsoft MVP
>>>> INETA Speaker
>>>> www.betav.com
>>>> www.betav.com/blog/billva
>>>> Please reply only to the newsgroup so that others can benefit.
>>>> This posting is provided "AS IS" with no warranties, and confers no
>>>> rights.
>>>> __________________________________
>>>> Visit www.hitchhikerguides.net to get more information on my latest
>>>> book:
>>>> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
>>>> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
>>>> -----------------------------------------------------------------------------------------------------------------------
>>>>
>>>> "Lit" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> William,
>>>>>
>>>>> What about when you have to process and send lists?
>>>>> I know I can send XML to SQL
>>>>> Is it always a bad reason to do client transactions?
>>>>> Can you tell me more about your "bad" experience of client
>>>>> transactions I am all ears.
>>>>> I would love to hear some good or bad stories so I can decide what to
>>>>> do.
>>>>>
>>>>> Thank you,
>>>>>
>>>>> Lit
>>>>>
>>>>>
>>>>>
>>>>> "William Vaughn" <(E-Mail Removed)> wrote in message
>>>>> news:O%(E-Mail Removed)...
>>>>>> If it were me I would probably call a stored procedure that started
>>>>>> the transaction ran all of the SPs, handled the exceptions, channeled
>>>>>> the logic and returned success or failure via RETURN... but that's
>>>>>> just me. I'm not a fan of client-side transactions...
>>>>>>
>>>>>> --
>>>>>> ____________________________________
>>>>>> William (Bill) Vaughn
>>>>>> Author, Mentor, Consultant, Dad, Grandpa
>>>>>> Microsoft MVP
>>>>>> INETA Speaker
>>>>>> www.betav.com
>>>>>> www.betav.com/blog/billva
>>>>>> Please reply only to the newsgroup so that others can benefit.
>>>>>> This posting is provided "AS IS" with no warranties, and confers no
>>>>>> rights.
>>>>>> __________________________________
>>>>>> Visit www.hitchhikerguides.net to get more information on my latest
>>>>>> book:
>>>>>> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
>>>>>> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
>>>>>> -----------------------------------------------------------------------------------------------------------------------
>>>>>>
>>>>>> "Lit" <(E-Mail Removed)> wrote in message
>>>>>> news:e0$(E-Mail Removed)...
>>>>>>> Hello,
>>>>>>>
>>>>>>> using ADO.NET 2.0, VS.NET 2005, SQL2005
>>>>>>> I need to execute several Stored Procedures under one transaction.
>>>>>>> Can I use just one transaction or have to use multiple ( then commit
>>>>>>> or rollback all )
>>>>>>> How does it work with ADO.NET
>>>>>>>
>>>>>>> Ado.Tran
>>>>>>> SP1 Called
>>>>>>> loop
>>>>>>> SP2 Called
>>>>>>> SP3 Called
>>>>>>> loop
>>>>>>> SP4 Called
>>>>>>> loop
>>>>>>> Sp5 Called
>>>>>>> Etc... etc...
>>>>>>>
>>>>>>> if any error
>>>>>>> rollback transaction ( or all transactions )
>>>>>>> else
>>>>>>> committe Transaction ( or all Transactions )
>>>>>>>
>>>>>>> Thanks for any help or other Ideas
>>>>>>>
>>>>>>> Lit
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>

>>

>
>


 
Reply With Quote
 
Lit
Guest
Posts: n/a
 
      9th Aug 2007
William,

I am hoping this is it.
I found an example of importing to an entire table.
I am hoping to be able to insert into a exiting table that has an identity
field.

Thanks for taking the time I appreciate it.

Lit


"William Vaughn" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Okay, there is no good way to use ADO.NET query classes to do bulk
> uploads. There are other ways however. The SqlBulkCopy class can take
> anything you can expose with a DataReader (DataTable to DataReader is
> supported in 2.0) and send it to SQL Server in a single high-speed
> operation.
>
> hth
>
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant, Dad, Grandpa
> Microsoft MVP
> INETA Speaker
> www.betav.com
> www.betav.com/blog/billva
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> __________________________________
> Visit www.hitchhikerguides.net to get more information on my latest book:
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
> -----------------------------------------------------------------------------------------------------------------------
>
> "Lit" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> William,
>>
>> This is NOT going to help me right now, it may in the future?
>> I am under time constraint to get things going.
>> I was only looking for some good pattern or guidelines to what would be
>> best to send large lists to SQL2005 via ADO.NET 2.0 ( Max of 3000 rows )
>>
>> Thank You,
>>
>> Lit
>>
>> "William Vaughn" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> "Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)"
>>> (Addison Wesley).
>>> I hope it helps.
>>>
>>> --
>>> ____________________________________
>>> William (Bill) Vaughn
>>> Author, Mentor, Consultant, Dad, Grandpa
>>> Microsoft MVP
>>> INETA Speaker
>>> www.betav.com
>>> www.betav.com/blog/billva
>>> Please reply only to the newsgroup so that others can benefit.
>>> This posting is provided "AS IS" with no warranties, and confers no
>>> rights.
>>> __________________________________
>>> Visit www.hitchhikerguides.net to get more information on my latest
>>> book:
>>> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
>>> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
>>> -----------------------------------------------------------------------------------------------------------------------
>>>
>>> "Lit" <(E-Mail Removed)> wrote in message
>>> news:Oqz%(E-Mail Removed)...
>>>> William,
>>>>
>>>> You are right about "always", What is the name of your latest book?
>>>>
>>>> Thank you,
>>>>
>>>> Lit
>>>>
>>>> "William Vaughn" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> Ah, I don't have the time and you don't have the patience to wait
>>>>> until I do...
>>>>> Nothing is ever "always bad" just as nothing is "always good". XML has
>>>>> its place. It's just been misused by too many that should know better.
>>>>> Client transactions put too much schema-dependent,
>>>>> business-rule-dependant code on the client. I think more logic should
>>>>> be run from a common platform.
>>>>> I discuss these issues in most of my books--even the latest. See
>>>>> Chapter 1 that discusses architectures...
>>>>>
>>>>> hth
>>>>>
>>>>> --
>>>>> ____________________________________
>>>>> William (Bill) Vaughn
>>>>> Author, Mentor, Consultant, Dad, Grandpa
>>>>> Microsoft MVP
>>>>> INETA Speaker
>>>>> www.betav.com
>>>>> www.betav.com/blog/billva
>>>>> Please reply only to the newsgroup so that others can benefit.
>>>>> This posting is provided "AS IS" with no warranties, and confers no
>>>>> rights.
>>>>> __________________________________
>>>>> Visit www.hitchhikerguides.net to get more information on my latest
>>>>> book:
>>>>> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
>>>>> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
>>>>> -----------------------------------------------------------------------------------------------------------------------
>>>>>
>>>>> "Lit" <(E-Mail Removed)> wrote in message
>>>>> news:(E-Mail Removed)...
>>>>>> William,
>>>>>>
>>>>>> What about when you have to process and send lists?
>>>>>> I know I can send XML to SQL
>>>>>> Is it always a bad reason to do client transactions?
>>>>>> Can you tell me more about your "bad" experience of client
>>>>>> transactions I am all ears.
>>>>>> I would love to hear some good or bad stories so I can decide what to
>>>>>> do.
>>>>>>
>>>>>> Thank you,
>>>>>>
>>>>>> Lit
>>>>>>
>>>>>>
>>>>>>
>>>>>> "William Vaughn" <(E-Mail Removed)> wrote in message
>>>>>> news:O%(E-Mail Removed)...
>>>>>>> If it were me I would probably call a stored procedure that started
>>>>>>> the transaction ran all of the SPs, handled the exceptions,
>>>>>>> channeled the logic and returned success or failure via RETURN...
>>>>>>> but that's just me. I'm not a fan of client-side transactions...
>>>>>>>
>>>>>>> --
>>>>>>> ____________________________________
>>>>>>> William (Bill) Vaughn
>>>>>>> Author, Mentor, Consultant, Dad, Grandpa
>>>>>>> Microsoft MVP
>>>>>>> INETA Speaker
>>>>>>> www.betav.com
>>>>>>> www.betav.com/blog/billva
>>>>>>> Please reply only to the newsgroup so that others can benefit.
>>>>>>> This posting is provided "AS IS" with no warranties, and confers no
>>>>>>> rights.
>>>>>>> __________________________________
>>>>>>> Visit www.hitchhikerguides.net to get more information on my latest
>>>>>>> book:
>>>>>>> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
>>>>>>> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
>>>>>>> -----------------------------------------------------------------------------------------------------------------------
>>>>>>>
>>>>>>> "Lit" <(E-Mail Removed)> wrote in message
>>>>>>> news:e0$(E-Mail Removed)...
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> using ADO.NET 2.0, VS.NET 2005, SQL2005
>>>>>>>> I need to execute several Stored Procedures under one transaction.
>>>>>>>> Can I use just one transaction or have to use multiple ( then
>>>>>>>> commit or rollback all )
>>>>>>>> How does it work with ADO.NET
>>>>>>>>
>>>>>>>> Ado.Tran
>>>>>>>> SP1 Called
>>>>>>>> loop
>>>>>>>> SP2 Called
>>>>>>>> SP3 Called
>>>>>>>> loop
>>>>>>>> SP4 Called
>>>>>>>> loop
>>>>>>>> Sp5 Called
>>>>>>>> Etc... etc...
>>>>>>>>
>>>>>>>> if any error
>>>>>>>> rollback transaction ( or all transactions )
>>>>>>>> else
>>>>>>>> committe Transaction ( or all Transactions )
>>>>>>>>
>>>>>>>> Thanks for any help or other Ideas
>>>>>>>>
>>>>>>>> Lit
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>

>>
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Object Transaction / Class Transaction Undo Without Database GoogleEyeJoe Microsoft C# .NET 3 25th Oct 2006 08:31 PM
Error message 3003 couldn't start transaction, to many transaction =?Utf-8?B?am9rb2Jl?= Microsoft Access Form Coding 4 24th Aug 2006 09:14 AM
"Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction." Ollie Riches Microsoft C# .NET 3 11th Mar 2005 05:23 PM
"Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction." Ollie Riches Microsoft ADO .NET 3 11th Mar 2005 05:23 PM
The root transaction wanted to commit, but transaction aborted Grober Microsoft ADO .NET 1 24th Nov 2003 02:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:35 AM.