|
You can manually limit the maximum amount of memory SQL is allowed to use, set it low enought to make sure you leave enough memory for the rest of your machine (Visual Studio requires a large amount of memory for example), this setting is harder on a production SQL box, leave that to a DBA, but I typically run my dev SQL instances with less than 200Mb of memory...
Is the exception you are getting a sql exception or a .Net exception? both can run out of memory and both have different ways of fixing the problem... Please give the fulle message and stacktrace...
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
Hi,
I'm trying to write Exchange Server 2007 interface using C#. Is there any way to access archived mails(Journal). I dont want to use WebServices so other than that is there any way?
Thanks
|
|
|
|
|
hi ...
In c# , click event and double click event is there. but in the hierarchical event call is from first call click event calls then double click event calls.
In our application we need these two scenario for example while click a button print "hi" , and while double click a button print "hello" only not in single click callback.
how can i handle these...
Thanks...
|
|
|
|
|
Hi
I had the same problem,and what I do is set a global variable(DateTime) to store the first click time,and count second click time subtrack first click time ,if the range is in your set, it will do another scope. sorce code like this
DateTime t1;
private void button1_Click(object sender, EventArgs e)
{
if (t1.ToBinary() == 0)
{
t1 = DateTime.Now;
label1.Text = "Hi";
}
else if (t1.AddMilliseconds(1000).CompareTo(DateTime.Now) > 0)
{
label1.Text = "Hello";
t1 = DateTime.MinValue;
}
else
{
t1 = DateTime.MinValue;
}
}
sorry my English is not good enough
|
|
|
|
|
If you think about it, then it is fairly obvious that you will get a single click event immediately upon pressing the mouse button - the second click has not happened yet, so the OS doesn't know this will be a double click. When the second click occurs within the double click time, a double click event is fired as well.
The best thing to do is to start a timer in the click event handler, and cancel it in the double click event. If the timer expired event happens, perform the "Hi" action. If you set the timer to a little larger than the double click time, then it will work as best you can.
You can get the current value for the double click time from SystemInformation.DoubleClickTime[^]
The only other solution is to re-design your UI to get rid of the problem - which is what most people do.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
I agree with the first part: A double-click is by it's very nature a click and a double-click. So does MS say it is.
I disagree that the best solution is to use a timer though. The correct use of click and double-click events is to use them so that the side-effect of click is always part of the side-effect of double-click, which logically follows from the fact that a doubleclick implies a click. Then there is nothing at all required in the code to handle the two cases - you simply implement the side effects and you're done.
For example, in a great many apps a click selects something, a double-click executes an action of some kind. If I open a file in Explorer by double-clicking it, I first select it, even if I may not think about that.
Having a component like a button do something on a double-click is completely different from the Windows logic and serves only to confuse users and complicate implementation. The standard ways of dealing with this situation are: 1) Add a context menu to the button (and perhaps some visual clue on the button to it's existence), 2) perform a different action if the button is clicked while a key (SHIFT/CTRL/ALT) is pressed, 3) use one button per action. Personally I tend to think alternative 3 is best in the majority of situations, as it's clear and logical and the user needs to do very little work to figure out how to use the program. Alternative 2 is least user-friendly, but works well in some cases. For example, Visual SourceSafe had many commands that could be invoked by buttons, but that took parameters. For example, the "show history" command has options like "labels only". VSS would display the dialog and require another click to accept the dialog before executing the action, but provided a checkbox "only show this dialog when the SHIFT key is down". Ticking the box made VSS execute the command with default parameters by a single click, while SHIFT+click still provides access to the parameters of the command. Since this was done consistently for many commands it amounts to a useful shortcut.
UI is *far* too important in most applications to allow dirty workarounds or laziness in general. It is the end user who should be lazy, not the UI designer.
|
|
|
|
|
I agree - that's why I added the bit about redesigning the UI.
But sometimes you are stuck with someone elses (rather stupid) interface design and have to make the best you can of a bad job.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Right.
IMO MSDN isn't providing enough warnings about that on the pages that describes the Click event. It shouldn't simply say "Occurs when the Button control is clicked.", it should say "Occurs when the Button control is clicked once or more." and then explain.
|
|
|
|
|
Now i have form1 and form2
datetimepicker1 and datetimepicker2 is in form1
i want to use datetimepicker1 and datetimepicker2 on form2 from form1,set datetimepicker1'modifiers and datetimepicker2'MOdifiers to public on form1, i wrote my code on form1 like this
string from, to;<br />
<br />
from = this.dateTimePicker1.Value.ToString("yyyy-MM-dd");<br />
to = this.dateTimePicker2.Value.ToString("yyyy-MM-dd");
it can work very well
then wrote my code on form2 like this
<br />
Form1 frm=new Form1(); <br />
string from, to; <br />
from = frm.dateTimePicker1.Value.ToString("yyyy-MM-dd");<br />
to = frm.dateTimePicker2.Value.ToString("yyyy-MM-dd");
when i run my code ,from=2010-01-09,to=2010-01-09 on form2
but when i select dateTimePicker1=2010-01-05, dateTimePicker2=2010-01-09 on form1,
then run my code ,it shows from=2010-01-05,to=2010-01-09 on form1,but it also shows from=2010-01-09,to=2010-01-09 on form2,it do not change anymore on form2,i think it may be read from the most beginning.
i want to get the changed dateTimePicker.Value,how could i do
thanks everyone?
modified on Sunday, January 10, 2010 1:38 AM
|
|
|
|
|
Firstly: Don't do it!
If you access controls on one form from another, then you are locking the design of teh two forms together - you cannot change one form without changing the other. This defeats one of the intentions of an OOP language at a stroke, and it why by default controls are not declared as public.
Instead, either:
1) Set up a public property or method on form2 which form1 can access to get the information it needs without knowning the internal details of form2.
or
2) Set up an event or delegate with form1 can subscribe to get the information.
Depending on what you are doing when you need the information will determine which way to go. If you need form1 to be aware when the datetimepicker has changed, then use (2), otherwise, go with (1).
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Dear friends,please help me
thanks.
can write an example ?
modified on Friday, January 8, 2010 2:18 AM
|
|
|
|
|
I dnt know what's IE adddress. Maybe you mean IP address? Then the answer is here: [^]
|
|
|
|
|
Thanks for you answer.
Sorry English is hard for me .
IE address=The Address in the browser's address bar.
|
|
|
|
|
|
No, not so far.
|
|
|
|
|
hi, try this:
System.Web.HttpContext.Current.Request.Url
|
|
|
|
|
How do i get the date, burned speed, manufactorer id of cd or dvd that i was burned?
|
|
|
|
|
Hi!
I've got a weird problem.
Console.Beep(int,int) method is supposed to use motherboard's speaker. In my case a sound comes from a sound card. How to get a true beep?
Thanks in advance
Greetings - Jacek
|
|
|
|
|
Some sound cards route the pc speaker to them. I would try to test if that is the case.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
If so, is there any work-around?
Greetings - Jacek
|
|
|
|
|
It is a hardware level thing, so you MIGHT be able to do it with some unmanaged code.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
|
It sounds pretty accurate - I remember the chip, and using it in designs. If you're interested - 8254 Timer Datasheet[^].
My personal favorite was the Signetics 25120[^] Write Only Memory (WOM).
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
I am trying to show a small form when you hover over this label. A image is on this form and thats it (form is borderless). When you hover over the label it comes up, when you move the mouse left or right or up or down it moves with it. Problem is it keeps flashing! What am I doing wrong?
private void lbSig_MouseEnter(object sender, EventArgs e)
{
sigForm.Location = new Point(Cursor.Position.X, Cursor.Position.Y);
sigForm.Show();
}
private void lbSig_MouseLeave(object sender, EventArgs e)
{
sigForm.Hide();
}
private void lbSig_MouseMove(object sender, MouseEventArgs e)
{
sigForm.Location = Cursor.Position;
}
|
|
|
|
|
Hi Jacob,
I guess this is what is going on:
mouse enters label, sigForm gets shown at same location, on top of label, hence label fires MouseLeave, formsig gets hidden, hence mouse on top of label again, etc.
suggestion: remove the sigForm.Hide() and choose another way to terminate your magnifying glass or whatever it is you are doing.
|
|
|
|
|