Monday, November 23, 2009

UI looks different on different PC's

Do you know in Winform (.net 2.0) UI can look different on different resolutions and DPI settings. Useful link below

http://stackoverflow.com/questions/185804/how-to-control-the-font-dpi-in-net-winforms-app

Friday, November 20, 2009

subversin control in visual stuido : step by step guide

a nice article on how to set subversion in visual studio

http://www.west-wind.com/presentations/subversion/

http://www.codeproject.com/KB/dotnet/SourceControl_VSNET.aspx

Monday, November 16, 2009

good sql server utility

some good ms-sql related utilities are as follows

1) Microsoft SQL Server Management Studio Express

http://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en

2) Sql Script builder > with this you can export both structure and data in a script file.

3) Microsoft sql data publishing...

windows forms timer

there are following types of Timers available in c#

1 vote down star


System.Threading.Timer,
System.Timers.Timer, and
System.Windows.Forms.Timer

and in some cases using one in place of another helps sometimes. :-)

Wednesday, November 11, 2009

online proxy server

online proxy server
http://www.kroxy.net

free image share sites

some free online image share sites are as below

http://www.img-share.com/

Tuesday, November 10, 2009

assembly location might change

there are times when assemble you reference changes to local copy, so always check the location of the assebly being reference (version etc) in the REFERENCE section of visual studio. I once had to debug for half day for this silly issue :-)

what to do when long running threads don't respond

Additional Information: The CLR has been unable to transition from COM
context 0x189558 to COM context 0x189408 for 60 seconds. The thread
that owns the destination context/apartment is most likely either doing
a non pumping wait or processing a very long running operation without
pumping Windows messages. This situation generally has a negative
performance impact and may even lead to the application becoming non
responsive or memory usage accumulating continually over time. To avoid
this problem, all single threaded apartment (STA) threads should use
pumping wait primitives (such as CoWaitForMultipleHandles) and
routinely pump messages during long running operations.

=======================

One simple remedy is the following

there are 2 things to try
1. goto "Debug", "Exceptions..." menu
2. Managed Debugging Assistants, uncheck ContextSwitchDeadlock

Or you can try following

=============================
Call routinely CurrentThread->Join(0), this implicitely calls
CoWaitForMultipleHandles and returns.




Thanks willy, this is working and pumping message.
But on my form, i have a label and a progress bar.
During this time, the progress bar is refreshed, but not the label.
Should i call an explicit update ?

This is my code :
this->Show();
this->Update();
for each(entry in entries)
{
TreatmentForOneOr2Secs();
this->progressBar1->PerformStep();
System::Threading::Thread::CurrentThread->Join(0);
}
this->Hide();

("this" is the form)

Do you know why the label isn't refreshed ?

thread invoke

Know something

http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/the-difference-between-invoke-and-begini



In short.

* Delegate.Invoke: Executes synchronously, on the same thread.
* Delegate.BeginInvoke: Executes asynchronously, on a threadpool thread.
* Control.Invoke: Executes on the UI thread, but calling thread waits for completion before continuing.
* Control.BeginInvoke: Executes on the UI thread, and calling thread doesn’t wait for completion.

Monday, November 9, 2009

raymond blog, nice one

lovely computer blog site, keeps you updated on whats happening around and some nice offers too :-)

http://www.raymond.cc/

Sunday, November 8, 2009

maharashtra landline phone number tracking

want to track a landline phone number in maharashtra, try this link below

http://210.212.176.226/phonesearch.php

special characters

some special characters are as follows

special characters ~ ( ) # \ / = > < + - * % & | ^ ' " [ ],

Saturday, November 7, 2009

datatable row selection

there are various wasys of searching in a datatable
.select
foreach
.rows.Find

do you know which one is the best approach and in which circumstances

http://msdn.microsoft.com/en-us/library/dd364983.aspx

picturebox image setting properties

are you aware of various things about picturebox. Looks similar but there is some significant differences :-)

pictureBox1.ImageLocation
pictureBox1.Image
pictureBox1.LoadAsync
pictureBox1.Load

http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/22b05cc9-45d9-4a73-a199-2c56801d63f9

all about rowfilter

all about ROWFILTER

http://aspdotnetcodebook.blogspot.com/2008/07/short-tutorial-on-dataview-rowfilter.html


string rowFilterString = EscapeLikeValue(e.Argument.ToString());

public static string EscapeLikeValue(string valueWithoutWildcards)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < valueWithoutWildcards.Length; i++)
{
char c = valueWithoutWildcards[i];

if (c == '*' || c == '%' || c == '[' || c == ']')
sb.Append("[").Append(c).Append("]");

else if (c == '\'')
sb.Append("''");

else
sb.Append(c);

}
return sb.ToString();
}