|
See point 1. Clickety[^]
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi!
I'm using a
ThreadPool.QueueUserWorkItem(GetData);
method to get some data (from sqldb). the GetData method is sth uses a DataAdapter object to fill untyped dataSet and returns its fitst table (Tables[0] - if != null of course)..
the problem is that the dataAdapter doesn't always fill the dataset - the table is not created when it's suppoused to be - the sql server received the querry and completed it (i checked it using profiler). well the only solution i was able to get is
<br />
int safeCt = 5;<br />
while(dataSet.Tables.Count == 0 && safeCt > 0) {<br />
try {<br />
dataAdapter.Fill(dataSet);<br />
if(dataSet.Tables.Count == 0)<br />
System.Threading.Thread.Sleep(500);<br />
} catch { }<br />
safeCt--;<br />
}<br />
for 6 out of 200 querries the fill was called twice..
well, it works, but is there any better way?!
life is study!!!
|
|
|
|
|
Doesn't the switch statement in C# support multiple options inside the case clause??? I'm sorry if I missed it.
|
|
|
|
|
No, but you can use empty case labels to achieve this. Example
switch (x)
{
case 1:
case 2:
DoOneAndTwo;
break;
}
|
|
|
|
|
blackjack2150 wrote: multiple options inside the case clause???
What do you mean?? Another switch case statement??
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
I mean something like this:
switch(DayOfWeek)
{
case "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" : work = true;
case "Saturday", "Sunday": party = true;
}
VB .NET for example has it and that's quite sad for me, as I've preferred C# over VB.
|
|
|
|
|
switch (DayOfWeek)<br />
{<br />
case DayOfWeek.Monday:<br />
case DayOfWeek.Tuesday:<br />
case DayOfWeek.Wednesday:<br />
case DayOfWeek.Thursday:<br />
case DayOfWeek.Friday:<br />
work = true;<br />
break;<br />
case DayOfWeek.Saturday:<br />
case DayOfWeek.Sunday:<br />
party = true;<br />
break;<br />
}
well, it works for me... think you may be doing something wrong
My second computer is your linux box.
|
|
|
|
|
Hi all,
I have a complicated form. I call that form from my main form and then close it.
After close I call GC.Collect() to ensure that all the memory used for the form has been removed. But it still exited.
I load sos.dll and use !dumpheap -stat command to show memory and see that my form and all controls and objects the form use still existed.
I debug for a long time, remove delegates, dispose disposable objects etc. but the form didnt' go.
So how can I know which object hold reference to the form? (they call them root reference as I remember). Any article, any tool to solve my problems.
It's critical, please help me.
Regards,
|
|
|
|
|
|
You can use memprofiler (mentioned in the other post) and you can also use the CLR Profiler[^] tool.
You really shouldn't be calling GC.Collect() yourself in any case. All this does is force a garbage collection cycle to run "out of turn", which ultimately causes more work for the GC. Whenever a collection cycle runs, your applications main thread is frozen for the duration of the cycle...so the more times you force a collection, the worse your performance will become.
Once you close the form, are you setting the variable reference to null ?
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Hi all,
i want to show multiple colors in a single progress bar,
do we have any customized tool for this,.
thnx in advance
prashath
|
|
|
|
|
I'm afraid you're going to have to make your own progressbar class.
This article might help:
http://www.codeproject.com/cs/miscctrl/colorprogressbar.asp
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
i know its a very huge process to create a new pgbar,
but here my req needs multiple colors in a sigle pgbar, i wil be verymuch happy if u can help me to get a pgbar which satisfies my req.
thnx in advance,
prashanth
|
|
|
|
|
It's not at all a very HUGE process. If you would take a look at the source code from the article in my previous post, you'll see that nothing in there is difficult to understand, and if it is, we will be happy to clarify. No one here, not even me on a very bored day, is going to write this especially for you.
Of course if it exists you might get lucky and someone will refer you, but I think writing it is going to be faster.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
thnk you, i've started building it, hope i'll left with answer
i'll come again if i struck some where.
prashanth
|
|
|
|
|
i want to show the task manager Task Manager's Performance tab in my programm.....i am working on a project and i want to show the CPU usage during execution.....for this i have to go to Task Manager's Performance tab .....i want to access it from my code.....
how can i do it so that the performance graph should appear on one side of my application form.....
|
|
|
|
|
I think you are beter of if you try to read the performance monitor, and build your own graph.
there are plenty of examples here that show you how to do that.
My second computer is your linux box.
|
|
|
|
|
hi,
I am having Form with controls llike combobox,list,textbox..
Now I want to save the values of a form to an XML file
how can do that
Pls Help Me
With Regards
Prasad
|
|
|
|
|
|
You could try using Application Settings. The settings themselves are saved in an xml file, but you can access them easily through the System.Configuration.ConfigurationManager.AppSettings property, without bothering about the xml stuff behind it at all.
|
|
|
|
|
hi,
can u more brief pls
I am not getting u.
With regards
Prasad
|
|
|
|
|
I think this article's worth checking out:
http://msdn2.microsoft.com/en-us/library/ms171565.aspx[^]
It starts like this:
"Using managed code, you can create new application settings and bind them to properties on your form or your form's controls, so that these settings are loaded and saved automatically at run time."
I thinks that's what you're looking for.
|
|
|
|
|
Is there any way to show web links as hyperlinks in textboxes.
I have seen this http://www.codeproject.com/cs/miscctrl/LinkTextBox.asp
but i also want to have normal text in the textbox as well, basically its a notes field on my form and the user wants to just click on any webpages that may appear in the notes.
TIA
|
|
|
|
|
Just discovered RichTextBox's and they seem to do the trick
|
|
|
|
|
Hi,
I created a new windows application project within visual studio.
I then inserted a new class MDI parent to implement a MDI application.
I substituted the original program main form for the MDI.
When i click in the new icon (the code of the handle to create the new sub form is there), it doesnt make a thing.
What is happening?
Any tips?
Thx,
Nuno
|
|
|
|