Click here to Skip to main content
15,895,256 members
Home / Discussions / C#
   

C#

 
AnswerRe: Production Rules Pin
Ashfield21-Jun-08 7:34
Ashfield21-Jun-08 7:34 
GeneralRe: Production Rules Pin
mymo_h21-Jun-08 7:45
mymo_h21-Jun-08 7:45 
QuestionOpen pdf file using c# Pin
Abdul Rahman Hamidy21-Jun-08 2:21
Abdul Rahman Hamidy21-Jun-08 2:21 
AnswerRe: Open pdf file using c# Pin
Paul Conrad21-Jun-08 3:50
professionalPaul Conrad21-Jun-08 3:50 
AnswerRe: Open pdf file using c# Pin
Luc Pattyn21-Jun-08 4:42
sitebuilderLuc Pattyn21-Jun-08 4:42 
Questionhow to export com dll(have created with c#) to .lib type library? Pin
iman_kh21-Jun-08 2:14
iman_kh21-Jun-08 2:14 
QuestionThreading and Database connection Pin
Farhan Ejaz21-Jun-08 1:22
Farhan Ejaz21-Jun-08 1:22 
AnswerRe: Threading and Database connection Pin
Mbah Dhaim26-Jun-08 0:04
Mbah Dhaim26-Jun-08 0:04 
the problem is u always create new instance of database connection in your background thread, i mean you always call this code in your backgroundworker:
MySqlConnection connection = new MySqlConnection(connectionString);
MySqlCommand command = connection.CreateCommand();
command.CommandText = yourSelectQuery;
MySqlDataAdapter adapter = new MySqlDataAdapter(command);
adapter.Fill(yourDataSet);
command.Dispose();
connection.Close();
connection.Dispose();


this database connection remains in pool event if you leave your background worker

i suggest you create static field, or property in your DataLayer that hold for your database connection. Fill with correct connection string. DataCommand keep created in background worker. Dispose that datacommand object and your adapter after fill your dataset object. that will only 1 database connection remains in your database pooling.

i hope this will help.

dhaim
program is hobby that make some money as side effect Smile | :)

QuestionI NEED HELP? Pin
edinium20-Jun-08 23:56
edinium20-Jun-08 23:56 
JokeYes, you need. Pin
Giorgi Dalakishvili21-Jun-08 0:32
mentorGiorgi Dalakishvili21-Jun-08 0:32 
GeneralRe: Yes, you need. Pin
MarkB77721-Jun-08 0:36
MarkB77721-Jun-08 0:36 
GeneralRe: Yes, you need. Pin
Giorgi Dalakishvili21-Jun-08 1:20
mentorGiorgi Dalakishvili21-Jun-08 1:20 
GeneralRe: Yes, you need. Pin
Paul Conrad21-Jun-08 3:51
professionalPaul Conrad21-Jun-08 3:51 
GeneralRe: Yes, you need. Pin
Muammar©21-Jun-08 2:56
Muammar©21-Jun-08 2:56 
AnswerRe: I NEED HELP? [modified] Pin
Paul Conrad21-Jun-08 3:54
professionalPaul Conrad21-Jun-08 3:54 
GeneralRe: I NEED HELP? Pin
Gareth H21-Jun-08 4:45
Gareth H21-Jun-08 4:45 
GeneralRe: I NEED HELP? Pin
Paul Conrad21-Jun-08 4:48
professionalPaul Conrad21-Jun-08 4:48 
QuestionC# Crystal Report Loading Bar Pin
Rizawn20-Jun-08 22:43
Rizawn20-Jun-08 22:43 
QuestionSetting Current Directory. Pin
Saiyed Alam20-Jun-08 21:54
Saiyed Alam20-Jun-08 21:54 
AnswerRe: Setting Current Directory. Pin
S. Senthil Kumar20-Jun-08 22:03
S. Senthil Kumar20-Jun-08 22:03 
AnswerRe: Setting Current Directory. Pin
Giorgi Dalakishvili20-Jun-08 22:10
mentorGiorgi Dalakishvili20-Jun-08 22:10 
AnswerRe: Setting Current Directory. Pin
Abhijit Jana20-Jun-08 22:31
professionalAbhijit Jana20-Jun-08 22:31 
QuestionTreeView Padding Pin
Muammar©20-Jun-08 20:46
Muammar©20-Jun-08 20:46 
AnswerRe: TreeView Padding Pin
mav.northwind20-Jun-08 21:39
mav.northwind20-Jun-08 21:39 
GeneralRe: TreeView Padding Pin
Muammar©20-Jun-08 21:42
Muammar©20-Jun-08 21:42 

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.