|
Guffa wrote:
That code is not very good. You are opening a new database connection for every single query you run, which is just a waste of resources.
Connection pooling should take care of that.
|
|
|
|
|
Connection pooling helps a lot, but it's still a waste of resources to open and close connections over and over again.
Besides, if you don't close the connections, even the pooling can't save you.
---
single minded; short sighted; long gone;
|
|
|
|
|
what changes you want me to do, to make it work well
himanshu p.taunk
|
|
|
|
|
I need the C# codes snipset to establish a connection to a database [Club.mdf] created using SQlExpress bundled with visual studio.net 2005.
Note: Am handling a web project.
Thanks
|
|
|
|
|
SqlConnection con = new SqlConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\club.mdf");
using this statement u can connect to your club.mdf database
himanshu p.taunk
|
|
|
|
|
Example:
if a end user select time in dropdown according to that the alert to be Popup
somasekaran.M.C
|
|
|
|
|
Use timers to poll the value of DateTime.Now and when it's past your alarm time, show the alarm.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
If you use System.Threading.Timer you don't have to poll. I believe it uses the TimerQueue API
|
|
|
|
|
Hi all, is there a way to set a color to be used for the text and background of a control when its enabled state is set to false?
Thank you!
|
|
|
|
|
hi
look in the Syste.Drawing.SystemBrushes class
regards
|
|
|
|
|
Thank you, but I don't understand: the SystemBrushes doesn't seem to have methods to set System Colors. What I need is to change the disabled text color from grey (I think ControlDark) to Black...
|
|
|
|
|
Hello,
I think he wants to change the SystemBrushes and Colors.
And AFAIK, this is not possible.
All the best,
Martin
|
|
|
|
|
Hi guys. Is there a way to access the mailbox of webmail services like hotmail ? What I need, is a way to get headers of new messages from different webmail accounts. It's all clear with pop3, but I haven't found anything on webmail.
There was an article about 3 years ago here, about how to access hotmail, but it seems hotmail people blocked this way.
Thanks in advance.
|
|
|
|
|
I don't think it's a queston of blocking. Hotmail is a web app. They either expose a way to read the mail, or they don't.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
gmail let you use thier service as a pop3 service. Hotmail does not have anything like that as i know of. Yahoo had it for a while but i think they removed it. you can only access it from a web browser.
|
|
|
|
|
i am placed images in panel.. am also placed scroll bar..
when any message boxes displayed over an image get erased it
it also erased when i scroll the scroll bar, the image is going out of focus to the screen
Send me some tips to avoid it.........
Surendar
|
|
|
|
|
Hi,
paint/draw your stuff in a paint handler, and nowhere else.
The paint handler gets called when something needs to be repainted; and also
when you call Invalidate() e.g. because the drawing needs a change.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi,
I am working on Windows application using language C#. Actually I want to write the code to convert from MS word into PDF document.
In this process I need to add docuPrinter Library(COM Component) as reference. But it is not there in COM Component. How should I add DocuPrinter Library in my project or is there any another way to handle this?
I will be thankful to you.
adil kazmi
|
|
|
|
|
I think you'll have more luck asking this of DocuPrinter's developers - or consulting their support docs:
http://www.neevia.com/support/[^]
"It was the day before today.... I remember it like it was yesterday."
-Moleman
|
|
|
|
|
Actually i have a class shown below.
class demo
{
DbConnection mConnection;
string Connectionstring;
};
then i create an object of demo like below
demo d=new demo();
Now i want the following
oledbcommand comm=new oledbcommand();
comm.connection= d; // what i want here is d should return mConnection and
// nothing else.
is there any way to do so.
Pls help.
|
|
|
|
|
What you want is against the basic principles of object oriented design and language. No you can't. I suggets you read a C# course book and focus on sections regarding properties. You vvcan attach mConnection to a public property, say you name it Connection.
then you can say: comm.connection=d.Connection.
You also can make teh member mConnection publc and then you refer to it as: d.mConnection
Rudolf Heijink
|
|
|
|
|
You *can* do it, via conversion operators. I'd concur that it's not a great idea, but it can be done.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes, you can define an explict conversion between one class and another.
Try this[^]
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
You can create a class by inheriting the Connection class.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|