|
Hi All
I am into developing a desktop application with MySQL as the back end. I have created a static class that works as a Data Layer ie. encapsulated MySQL functions in the class and use the Idatacommand interface to interact with the class.
I have separated the application into tiers where a tier gets the dataset and the UI consumes the data. For larger queries at times i have used background workers. The queries are run on background and finally the data binded.
My problem is that even if i set the connection pooling to false, a new connection is created by the background thread Also even though i dispose the command object as well as connection objects the connection remains in the pool. The pool maintains around 7 connection for my application and then the problem starts when the queries and database locks stop working...
Even if the connection pooling is OFF multiple connection opens up and hangs the queries
Appreciate all for ur kind suggestions
Thanks....
thanx for the support
|
|
|
|
|
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
|
|
|
|
|
i wrote stock prog. with c# for pocket pc..the data is writed in XML (cause transfer from PC to Pocket PC is fast ???i think)..the problem is while loading program, the program is bit slow cause of data in XML..is there any engine ore embedded or cab. that can help me to read fast XML.Thank you
|
|
|
|
|
With your English.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
, short, sharp, and too the point. I like that
|
|
|
|
|
Thanks
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
MarkBrock wrote: short, sharp, and too the point
Yes, it is.
MarkBrock wrote: I like that
I second that.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
That was the Joke of the day
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Yes, you need help on many aspects. First, pick a better subject line, instead of "I NEED HELP?". Secondly, clean up the grammar a bit. Thirdly, be a bit more clear about what you are having trouble with. Just saying the program is slow because of XML data doesn't help diagnose your program's problem very well.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
modified on Saturday, June 21, 2008 10:47 AM
|
|
|
|
|
Paul Conrad wrote: Thirdly, be a bit ore clear about what you are having trouble with.
I don't think he needs help with cleaning up his ore
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Thanks, garth, I fixed it. Should have been "more"
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Any Idea how to setup a progress bar for the crystal report viewer ..didn't find much on google..
Q@!$3r
|
|
|
|
|
Hello, I want to set this "D:\uHTMCM_200608 up\uHTMCM\bin\Debug" path as my current directory. how can I do this plz?
|
|
|
|
|
|
You can use SetCurrentDirectory Method of Directory class.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
using System.IO;<br />
Directory.SetCurrentDirectory("Path");
|
|
|
|
|
Hi,
Any idea how to increase/decrease the horizontal spacing between the nodes in a treeView??
Thank you guys!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi!
You'll have to p/invoke SendMessage to send TVM_SETINDENT to the TreeView .
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
mav.northwind wrote: You'll have to p/invoke SendMessage to send TVM_SETINDENT to the TreeView.
doh!
I just need to set a proper margin/spacing between the node without having to know about rocket since
Thanks anyways mate
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Oh come on, calling SendMessage after looking up the message in MSDN is not rocket science.
The message definition can be found in CommCtrl.h in the Platform SDK Includes: TV_FIRST is 0x1100 and TVM_SETINDENT is TV_FIRST + 7 .
The link to MSDN is here[^].
Just try it, it's really not that hard!
If you still have problems, come back here for help.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi.
I have the same problem, but I couldn't find the relation between calling SendMessage and increase/decrease the horizontal spacing between the nodes in a treeView??
I think , we have to change a property to set them !
Isn't it ?
|
|
|
|
|
em doing image processing project in C# ....so can any one tell me dat how to
use acquisition toolbox of matlab in C#...??
|
|
|
|
|
Probably the matlab website would be your best bet.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
hello..
can someone tell me the codes for this scenario..
i want to select a column file from a datagridview on form1 and then if i click the open button that file would open to a multiline textbox on form2..
only on column zero can be clicked to go to form2 textbox..
ginji
|
|
|
|
|
Buy a book. Read my article on how to use google. Generally try to do a little research before spewing out all your questions here.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|