[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Multiple Connetions in VB.NET SQL Stored Procdure

Posted on 2007-04-09
2
Medium Priority
?
183 Views
Last Modified: 2012-05-05
I am writing a SQL stored procedure in vb.net and having problem with the
context connection=true

It seems that you can only do one thing at a time, while what I am looking to do it loop through one file and update a field with an update at the same time.

I have the connection with the data reader with no problem, but what about the update command, what connection does that use? Do I just use a new connection in the traditional way without the connection=true?

Seems like there should be a better way.

Thanks
Randy Miller
0
Comment
Question by:randymiller
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 18880715
what kind of update will it be?
you might be able to run a UPDATE statement directly instead of doing a SELECT + UPDATE rowbased.

otherwise, you will have to complete to read the entire datareader (for example, into an array), close the data reader, and then  run the update statement looping on the array items.

CHeers
0
 
LVL 3

Expert Comment

by:JipFromParis
ID: 18890966
angelIII suggestion is great. If you can perform a single update, do it. Otherwise you will have to open a new regular connection because multiple instances of the context connection can't coexist in a single connection context, neither do multiple active result set (MARS).
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question