|
You don't need two methods Gmail1 and Gmail2 . Keep only one method and that method should accept the necessary details required for connection. You need to start two threads and execute the method. If you have any shared data that both threads will read/write, you need to use lock.
When accessing controls from worker threads you need to use Invoke /BeginInvoke to avoid cross-thread errors. This[^] ebook should help to get started.
Best wishes,
Navaneeth
|
|
|
|
|
|
Perhaps this would be more soapbox / lounge material, don't you think??
|
|
|
|
|
You are just not my type.
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
|
|
|
|
|
|
And that is why you provide an e-mail link?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
I was new and uneducated! Now I have to block his emails (8 so far in 10 minutes) and remove the link.
|
|
|
|
|
We have a flood of unusually clueless people right now. I suspect they are mostly CSS.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi
i developed an application that used a datagridview to show the records and it will frequently update (insert a record or delete a record)
some times datagridview will crash and show me a big red sign (like a big "x") on the full client rectangle of itself!
i do not know what is going on and what statement cause this problem and how can i prevent the problem?
what should i do ?
thanks in advance...
|
|
|
|
|
I'd suggest debugging.
PS Liquid Nitrogen will do also.
|
|
|
|
|
i have done that with simple debugging but the problem still persists and i do not know what should i do and what cause this problem
please explain me more
|
|
|
|
|
I have the same problem
|
|
|
|
|
and at last i get the answer:
in fact , there is a malicious thread that want to access my DataGridView !
some thing like a high frequently repeatable time tick or ...
in fact i had to use this.Invoke() with parameters that will rise the update DataGridView Method!
i used the fallowing solution!
delegate void AddDatevalueHandler(object[] newRow);
delegate void DeleteDatevalueHandler(string deletedRow);
.
.
.
private AddDatevalueHandler AddHandler;
private DeleteDatevalueHandler deleteHandler;
.
.
.
AddHandler = new AddDatevalueHandler(AddData);
deleteHandler = new DeleteDatevalueHandler(DeleteData);
.
.
.
object[] param ={ NewRow };
this.Invoke(AddHandler, param);
.
.
.
private void AddData(object[] NewRow)
{
dataGridAlarms.SuspendLayout();
ds_main.Tables[0].Rows.Add(NewRow);
dataGridAlarms.ResumeLayout(true);
}
private void DeleteRow(string ID)
{
dataGridAlarms.SuspendLayout();
this.Invoke(deleteHandler, parameter);
dataGridAlarms.ResumeLayout(true);
}
good luck
|
|
|
|
|
I have a question about GUID. I created a calender admin program that stores event data in an xml file. The xml file consist of an element called call ID. I am using ID as a key. Each event has a unique id.
My code generates a GUID for each new event. Currently I set up a method in my code behind to see if the GUID exist before I except the value of the new GUID. My understanding the sytem should generate a unique GUID each time you create one. I am thinking it is possible to get a duplicate GUID value, for example if I move the application to a new server.
Is this good practice or just a waste of resources?
Thanks,
David
|
|
|
|
|
Better safe than sorry.
I generally use a database, so the GUIDs I generate as primary keys gets checked by the database engine. But, yes, they do get checked and an Exception will be thrown if a duplicate is ever detected.
If you are creating your own database, you should perform the check.
|
|
|
|
|
According to MSDN (Remarks)[^], GUIDs are as globally unique as possible. The probability of seeing two the same in the world (universe?) is very low. The probability of seeing two the same on a single PC is infinitesimal. Your process looks fine, if you hit a duplicate then just generate a new one and continue. Alternatively you may like to consider a simpler key, such as time and date, sequence number, combination of the two etc. It all depends on how many items you expect to be storing.
|
|
|
|
|
I ended up rewriting an old calendar app because of the duplicate key problem. I will leave the duplicate check code in thier just in case, it seems like the fastest solution.
The amount of data depends on the client, I have some clients who enter large amounts of event, in those cases I push them to using sql server.
|
|
|
|
|
I once managed to get SQL 2005 to generate duplicate GUIDs. My insert statement managed to generate set of three identical GUIDs pretty consistently. Unfortunately we could never replicate this outside of our, rather large, application and so ended up just doing it differently. It was probably to do with the records being generated within the same millisecond, and so not that likely in most applications.
So, yes you should definitely check. While in theory you should never get duplicates I have had them to often.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
Hi,
How to Browse my Basic .aspx file with HTTPS instead HTTP, I come to know that it is possible through SSL, Is it any other way I can browse Page with Https.
I want to transfer a page which is cxml file with http how can i do it.
|
|
|
|
|
The only way to view any web page over https is to enable ssl connections to your webserver. That is what https means. However the resulting webpage will look the same either way so I would not bother to enable https connections on a development server, only on your live web server.
For details on how to set this up check out some of these sites[^].
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
|
that's three filled circles: big black, medium white, small black.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Thanks.
Couldn't we draw it with a circle command ?
|
|
|
|
|
what's a "circle command"?
I'd use Graphics.FillEllipse()
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
I suppose you could just use simple clipping when drawing these circles.
Life is a stage and we are all actors!
|
|
|
|