Click here to Skip to main content
15,887,214 members
Home / Discussions / Database
   

Database

 
GeneralRe: Calling sp_helptext from ASPNET Pin
tojamismis10-Dec-04 11:28
tojamismis10-Dec-04 11:28 
GeneralRe: Calling sp_helptext from ASPNET Pin
Edbert P12-Dec-04 13:34
Edbert P12-Dec-04 13:34 
GeneralGenerate generalized insert, delete and update statements Pin
CNU9-Dec-04 16:10
CNU9-Dec-04 16:10 
GeneralRe: Generate generalized insert, delete and update statements Pin
Colin Angus Mackay10-Dec-04 5:59
Colin Angus Mackay10-Dec-04 5:59 
QuestionServer -- keep connection open? Or open/close as needed? Pin
Judah Gabriel Himango9-Dec-04 6:32
sponsorJudah Gabriel Himango9-Dec-04 6:32 
AnswerRe: Server -- keep connection open? Or open/close as needed? Pin
Alex Korchemniy9-Dec-04 10:55
Alex Korchemniy9-Dec-04 10:55 
GeneralRe: Server -- keep connection open? Or open/close as needed? Pin
Judah Gabriel Himango9-Dec-04 11:45
sponsorJudah Gabriel Himango9-Dec-04 11:45 
GeneralRe: Server -- keep connection open? Or open/close as needed? Pin
Mike Dimmick10-Dec-04 2:28
Mike Dimmick10-Dec-04 2:28 
Yes, you should have separate connection objects. A connection is normally associated with some resource - for example, in SQL Server a connection is associated with a 'server process', which is itself tied to a User Mode Scheduler thread, which can only run on a single CPU.

Your concurrent operation here is a really bad idea as SqlConnection objects are not thread-safe. You're likely to corrupt the state of the object entirely if you call Open simultaneously on both threads. Even if you passed an opened connection to both threads, they're likely to stomp all over each others' internal TDS buffers. The SQL Server Managed Provider does all the high-level command formatting in managed code, then uses the Net-Library stack to submit the command to SQL Server.

Use SqlConnection's connection pooling. The cost of retrieving an existing connection from the pool is minimal.

Stability. What an interesting concept. -- Chris Maunder
GeneralRe: Server -- keep connection open? Or open/close as needed? Pin
Judah Gabriel Himango10-Dec-04 4:29
sponsorJudah Gabriel Himango10-Dec-04 4:29 
AnswerRe: Server -- keep connection open? Or open/close as needed? Pin
Dave Kreskowiak10-Dec-04 9:56
mveDave Kreskowiak10-Dec-04 9:56 
GeneralRe: Server -- keep connection open? Or open/close as needed? Pin
Judah Gabriel Himango10-Dec-04 10:00
sponsorJudah Gabriel Himango10-Dec-04 10:00 
GeneralStored Procedure using Disconnected Recordset Pin
web_app_developer9-Dec-04 4:00
web_app_developer9-Dec-04 4:00 
GeneralRe: Stored Procedure using Disconnected Recordset Pin
tojamismis10-Dec-04 12:42
tojamismis10-Dec-04 12:42 
GeneralSQL Server 2000 / Access Pin
| Muhammad Waqas Butt |9-Dec-04 1:08
professional| Muhammad Waqas Butt |9-Dec-04 1:08 
GeneralInsert photos and files Pin
CNU8-Dec-04 14:46
CNU8-Dec-04 14:46 
GeneralRe: Insert photos and files Pin
Alex Korchemniy8-Dec-04 16:55
Alex Korchemniy8-Dec-04 16:55 
GeneralRe: Insert photos and files Pin
CNU8-Dec-04 17:39
CNU8-Dec-04 17:39 
GeneralRe: Insert photos and files Pin
Alex Korchemniy9-Dec-04 10:53
Alex Korchemniy9-Dec-04 10:53 
GeneralRe: Insert photos and files Pin
Mekong River9-Dec-04 4:18
Mekong River9-Dec-04 4:18 
GeneralSQL query Pin
Paps28-Dec-04 3:49
Paps28-Dec-04 3:49 
GeneralRe: SQL query Pin
Yulianto.8-Dec-04 15:58
Yulianto.8-Dec-04 15:58 
GeneralRe: SQL query Pin
Alex Korchemniy8-Dec-04 17:02
Alex Korchemniy8-Dec-04 17:02 
GeneralRunning Batch Files - Windows Pin
sweep1237-Dec-04 22:24
sweep1237-Dec-04 22:24 
GeneralRe: Accessing SQL Server without static IP Pin
Steve S7-Dec-04 1:33
Steve S7-Dec-04 1:33 
GeneralRe: Accessing SQL Server without static IP Pin
Mekong River9-Dec-04 4:27
Mekong River9-Dec-04 4:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.