|
thanks for the help ,,,i know but i still have time and i hope that ill be able to achive somthing
wish me luck
|
|
|
|
|
Hello experts!
I am puzzled with this problem in using c# to communicate with an SQL database. Whenever I run the application for the first time, I always receive an exception error saying that the timeout period has expired in trying to connect to the database. When I run the application for the second time (and all succeeding times), the application connects instantly with no problem.
Why is my application unable to connect to the database when its in the first time? It would be too lengthy to post my code here so I am just expecting a general answer. I might be missing something simple here.
Thanks a lot.
|
|
|
|
|
Try to increase the querytime out value while connecting to database
|
|
|
|
|
It takes two lines of code to open a connection to an SQL Connection Database. If you are using more you may have self identified the problem. On a more serious note, if you are using a file based SQL Server Express database or the database instance is on your local machine and has not started yet it could be that the timeout is set too low to allow the db time to start-up. Trying setting your timeout to at least 30 seconds.
|
|
|
|
|
Can I apply a different font to *PART* of the text of an RTB at design time, or does it need done in the code at runtime?
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Hi Dan,
I don't think so, as the Rtf property is not available at design-time.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
You can't do it at design time, but you can do it at runtime. The only time I ever did anything like that was to put the RTF text in a resource and set the RTF property of the RTB at startup, using the text out of the resources.
|
|
|
|
|
I'm currently setting the text at design time, and just doing the select+font change in the constructor. That works, but struck me as a little ugly when looking at my old code; if MS won't give a better way to do it...
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
why do you need to do it at design time anyway?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
I don't need to, but aesthetically prefer to have as much static UI initialization as possible done in the designer.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Hi everyone,
Please can someone tell me how to shutdown my computer with C#?
I'll appreciate it. Thanks in advance.
Emma.
|
|
|
|
|
There is a command "SHUTDOWN". Just call it using Process.Start("...");
For help, use SHUTDOWN /?
|
|
|
|
|
Thanks stancrm, you were really helpful!
But you meant:
System.Diagnostics.Process.Start("ShutDown", "/s");
|
|
|
|
|
Here[^] is an article on doing it in VB.Net, should be fairly easy to convert to C#.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I've seen lots of these lately, are we going to have a outbreak of shutdown-virii soon?
|
|
|
|
|
Quick, I found a fix, I'm uninstalling the .net framework now!!
|
|
|
|
|
But can you do it before the shutdown timer starts?
Seriously, I really wish Windows had per-process permissions. For example, the user has to allow Process X to access the screen, use the sound card, etc. It would make life so much simpler, and could probably neutralise a lot of the viruses that are out there
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
And people thought the level of user complaints about Vista's UAC was bad.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
As long as it gives a clear error message, and provides the option to provide the necessary permissions I would be fine with it
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
You and 1% of other PC users (basically the masochists who've spent so long being popuped to death by ZoneAlarm that they never even noticed the new UAC popups). *shudder*
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
AVG doesn't annoy though, IMO.
Of course M$ can't do it right, but that doesn't necessarily mean that no one can, right?
|
|
|
|
|
IF you're talking about the anti virus software, AVG only prompts when it blocks something. Hopefully you encounter trojan web pages/email much less frequently than you install applications or reconfigure your OS.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Actually, no. Maybe I just frequent the wrong places on the 'net, but I get plenty of warnings from my trusty ol' AVG
More often than I install something probably, most programs don't need installing.
Anyhow, they could fix UAC for the biggest part with one small fix: a checkbox "Remember this choice for this application"
|
|
|
|
|
harold aptroot wrote: Actually, no. Maybe I just frequent the wrong places on the 'net, but I get plenty of warnings from my trusty ol' AVG
That or maybe AVG's gotten considerably more noisy since I last used it 5(?) years ago. I maybe see an avast warning once a quarter, I get a UAC prompt once a week after installing all my base apps.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Oh I don't know, I never get UAC prompts
(XP)
|
|
|
|