Can we use sql connections for threads?
-
HI, I am using SQL SERVER 2005. I need to find what is the best performance method for my 3 sql Data adapters. first method:- 1) Open sql connection 2) Initialise 1st data adapter and fill for the data table 1. 3) Initialise 2nd data adapter and fill for the data table 2. 4) Initialise 3rd data adapter and fill for the data table 3. 5) Process my work 6) close connection. second method:- a) 1. Open sql connection 2. Initialise 1st data adapter and fill for the data table 1. 3. close connection. b) 1. Open sql connection 2. Initialise 2nd data adapter and fill for the data table 2. 3. close connection. c) 1. Open sql connection 2. Initialise 3rd data adapter and fill for the data table 3. 3. close connection. d) 1. Use thread concept for a) ,b) and c) and take results for adapters. 2. process my work. so can any one tell me what is the best performance method? first method or second method? Thanks
-
HI, I am using SQL SERVER 2005. I need to find what is the best performance method for my 3 sql Data adapters. first method:- 1) Open sql connection 2) Initialise 1st data adapter and fill for the data table 1. 3) Initialise 2nd data adapter and fill for the data table 2. 4) Initialise 3rd data adapter and fill for the data table 3. 5) Process my work 6) close connection. second method:- a) 1. Open sql connection 2. Initialise 1st data adapter and fill for the data table 1. 3. close connection. b) 1. Open sql connection 2. Initialise 2nd data adapter and fill for the data table 2. 3. close connection. c) 1. Open sql connection 2. Initialise 3rd data adapter and fill for the data table 3. 3. close connection. d) 1. Use thread concept for a) ,b) and c) and take results for adapters. 2. process my work. so can any one tell me what is the best performance method? first method or second method? Thanks
third method:- 2) Initialise 1st data adapter 3) Initialise 2nd data adapter 4) Initialise 3rd data adapter 1) Open sql connection 2) fill for the data table 1. 3) fill for the data table 2. 4) fill for the data table 3. 6) close connection. 5) Process my work As to your second method... you do know that the DataAdapter will handle the open/close for you don't you? Better yet, don't use DataAdapters, but that's another subject. P.S. And why use separate ones rather than only one?