|
Dear Emran, I'm realy happy to help you, please don't be so sensitive, you're NOT bothering me at all.
For the loading problem, I feel it's not the SQL timeout, I really doubt it. Do you make any other connections? like using sockets? any other procuders that uses timeout, like browser component?, try to debug your application to that timeout exception, and trace its source. You should make sure that it's SQL timeout before tapering with the connectionstring. Also you said that the old value is 15 seconds. Does your application throws that exception after 15 seconds of loading, or more? or less?? Such answers may help you identifying the source of the exception.
Anyway, if you want to change the Timeout of your connection, don't do it directly from your application's config file, as it changes by building your app. Do it by changing the connection string as follows:
1- Right click on the project's name in the solution explorer.
2- Click on properties
3- Click on the settings tab (located to the left usually)
4- You should see your connection string to the right. When you click on it, a small button with three dtos on it "..." should appear at the right end of the field, click on that button.
5- On the dialog that shows up click on "Advanced" button
6- A property page should appear. Shearch for the timeout property and change it to the value that suits you.
If that solves your problem, then thank God, but if not, try to post me more of your loading code in your constructor and FRAME_LOAD event handler. Also post the Call stack of your exception, so that we could trace the source of the timeout, as I'm not convinced that the problem is in the SQL timeout.
If you have ANY question at ANY time, don't think twice. Post it, or even send it to me as an email, OK?;) I'm waiting for your reply to see if this works out.
|
|
|
|
|
I got a String returned from Database which has 3 lines, like "Test1\n Test2 \n Test3", but it showed in C# TextBox as "Test1 Test2 Test3". It seems C# TextBox can't preserve the line feed character. How can I make it show in TextBox as 3 lines?
Thanks
TinaQ
-- modified at 18:57 Tuesday 16th May, 2006
|
|
|
|
|
1. Make sure your TextBox 's Multiline property is true .
2. TextBox es don't like "\n". Use String.Replace("\n", "\r\n") on the data to give it the CRLF newlines it likes.
--
I've killed again, haven't I?
|
|
|
|
|
You should replace the \n with Environment.NewLine rather than hard coding \r\n
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks a lot, Everyone! Now it worked.
-- modified at 20:06 Tuesday 16th May, 2006
|
|
|
|
|
If you insert Environment.NewLine and Multiline is true, the text will show as multiline. If not, post your code.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Now it worked, sorry it's my mistake before. Thanks a lot!!!
|
|
|
|
|
Does anyone know how to stop a service form being killed by the Task Manager or any other method other than the services own stop function.
If this is at all possible?
Cheers
|
|
|
|
|
I don't think it is, as it wouldn't be a particularly desiarable behaviour (unless you were writing a virus or something).
The best way to stop users from meddling with task manager is through user accounts and permissions - an often neglected, but very important, part of system administration.
|
|
|
|
|
Yes, on the Stop function loop for 45 seconds, the service stoper will time out. Now this is kind of stupid to do.
My eMail control
My Blog
|
|
|
|
|
The problem I have this that we have written a service/application that monitors usage and controls access using a booking system to around 3000 workstations, but some users have found that by killing the service this then stops the service from logging them out when the booked time has elapsed
I supposed then answer is testing the current user who is tiring to exit the service and testing the system exit status.
Looping on the on stop would work if you could tell if the workstation is in a state of shutting down forced or not.
|
|
|
|
|
This is more a training problem than a computer problem.
Solution:
Step 1: Identify the user.
Step 2: Fire the user.
Repeat as necessary.
|
|
|
|
|
|
Is there any way to find the compiler's CLR version to use in an #if clause?
Something like:
#if CLR == 2.0
//do this
#endif
Thanks in advance,
Rei
|
|
|
|
|
Every .Netframework leaves a key in:
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy"
For example if the machine has 2.0 Framework installed then there will be:
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v2.0" key in the registry
try this code:
if (Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\.NETFramework\\policy\\v2.0") != null)
{
//Do something
}
but that will work fine with the if statement, not with the preprocessor directive #if.
|
|
|
|
|
You can't access any C# constructs from the precompiler directives though... only the precompiler variables and a small handful of comparative expressions.
|
|
|
|
|
Sorry for the mistake. I fixed my message though. I will look for it, if I find something I'll let you know.
But, can you give me a hint why you want it in a preprocessor directive rather than ordinary if statement?
|
|
|
|
|
I'm trying to use System.Drawing.BufferedGraphics, which is only available on .NET 2.0. I could use System.Drawing.Bitmap instead, but it's slightly less performant.
Also, some of the form mouse events are slightly different between the two versions.
I want to avoid having two copies of the code if I can, so I want to use the preprocessor to distinguish between the two.
There's one variable, VC_V7 that's used in an example in the C# documentation on MSDN, but that's only for Visual Studio (I think... I'm not sure why it'd be VC_V7).
Thanks for helping
|
|
|
|
|
http://msdn2.microsoft.com/en-us/library/0feaad6z.aspx[^]
The C# compiler itself defines no symbols or macros that you can use in your source code; all symbol definitions must be user-defined.
That's why there's no documentation
Guess I'll have to find some ways to work around it.
Thanks though.
|
|
|
|
|
Hi. I have a winform (with fade-in and fade-out effect) and I run it on VS 2003 and works great. But when I use VS 2005, the winform appears like with flicks, it's like it had a rendering problem. The example works great with VS 2003, but I have to run in in VS 2005.
Any ideas??
Thanks a lot !!!
|
|
|
|
|
Try this in the form's constructor:
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);
If that doesn't work, try playing around with the other ControlStyles things.
That might fix it.
|
|
|
|
|
I still have the problem.
Any other ideas ??
Thanks a lot !!!!
|
|
|
|
|
Hmm... try turning off the Application.EnableStyles thing in the Main() method, if it's there.
|
|
|
|
|
Reinux, I can't see the option you're reffering , only one: Application.EnableVisualStyles(); but it isn't take any parameters.
Thanks a lot !!!
|
|
|
|
|
Try taking the whole line out.
It's sorta optional.
|
|
|
|