spicy.net: May 2006

spicy.net

Friday, May 19, 2006

Using Notepad as your virtual diary...

Whenever I get into for conference calls I used to open notepad and start to log the same. After few days if I open that notepad I used to wonder on which particular days call I took this note. Yeah sometimes I used to forget to type in the current date and time before starting take notes]. Today I got to know this interesting tip from Vadivel's Blog.

Step 1: Open notepad

Step 2: Type .LOG as the first line of the file and press the carriage return [Enter key]

Step 3: Save and close the file.

Step 4: Double click on the file and open it ... you could notice that notepad appends the current datetime at the end of the file and places the cursor on the next line.Each and everytime you open the file it automatically appends the current datetime and places the cursor on the next line.

How to make your Web Reference proxy URL dynamic

I have been facing a problem in my project that how to make the URL property for a web reference to a web service, configurable in a config file instead of compiled in the web reference proxy. This is most useful when you want to deploy a project with a web reference between different business environments (like between Testing/QA and Production) without recompiling the project. There is a simple way to do this that requires no coding at all on the developer's part (provided you are using Visual Studio for .NET).
Step1:
Add web service reference in your project After you have added your web reference (which creates the proxy class with references to the web service for you automatically using VS .NET), you need to set your solution view to 'Show All':This shows the Reference.cs file for the Reference.map. This is the proxy class file that VS.NET generates automatically for you when you add a web reference.

Step2:
If you look at the web reference properties you can see that there is a configuration setting called 'URL Behavior'. This setting is by default set to Static. we need to change this setting to Dynamic.Doing this in VS.NET does two things for you. It changes the Reference.cs file to have the code to look for the WSDL URL in the project's web.config file Now you can set the URL to different servers for deployment in different environments, without having to change the code. You just change the URL in your config file for your project.

Sample:



Thursday, May 18, 2006

Adding multiple instance of a control in single click !!!

I think you will be surprised to find there is a provision in VS.NET to add multiple instance of a control to the designer. For this just press the ctrl key while selecting the control, and press ctrl key again before drawing the control over the designer, now it is ready to draw as many controls as you want. If you are done with it then press ctrl key again... thats it....One of the undocumented feature in .NET :-)

Tuesday, May 16, 2006

Creating Zip files programmatically through .NET !!!

I came across with a requirement in my project to compress a folder or files programmatically using .NET. Though I know we can do it using third party components to do this, But one of my friend vadivel gave this URL from MSDN Article, which explains the way to do it without using any third party components. But for this we need J# redistributable package to be installed in your box.

ORACLE Means

Oak ridge Arithmetic and Computer logic Engine !!!