C Sharp
How to cope with designer errors in Visual Studio
by silent wind on Sep.17, 2011, under C Sharp, Development
From time to time, when you have some errors in your controls, Visual may just stop responding altogether and forces you to restart without any indicator on what happened and how to fix it. To overcome this, there is two things developers should keep in mind:
- Check database and connection routines, make sure they are initialized properly or blocked from running by checking the special property DesignMode (available as Form.DesignMode and UserControl.DesignMode).
- To see the cause of the error, you have to debug Visual Studio itself. When designer error happened to you, choose debug this program and start a new instance of Visual Studio. The second instance should give you the unhandled exception and the code location of the error.
Fetching data from the web with C#, the right way
by silent wind on Jun.30, 2011, under C Sharp
I don’t know why the top results from Google always involve more than 10 lines of code and loads of comments when actually you can just do this:
byte[] Data = new WebClient().DownloadData(FrameURL);
You can try DownloadString and DownloadFile based on your requirements