ASP.NET Custom role provider

Easy guide to write your custom role provider

Merge splitted .mkv files

Learn how to merge splitted .mkv files (.mkv001,.mkv002...)

How to Zoom in and Zoom out your sql execution plan ?

Tool to tune your sql query

send .exe files with gmail

How to send files having blocked extension with Gmail ?

Multiple home pages in Internet explorer

How to set multiple home pages in internet explorer ?

12/09/2009

How to set date time as text to a excel in DD/MM/YYYY format using ASP.NET ?

Did you ever try to set a date as text to Excel cell using asp.net ? I had this interesting problem today. The date that I have been passing from my code is something like this '02/06/2009' (dd/mm/yyyy) .But When I check the Excel it appeared as '06/02/2009' (mm/dd/yyyy) . Dates with date > 12 will appear correctly in the excel . I tried by setting the format of cells to dd/mm/yyyy but no luck. So How will we achieve it ?

Solution :

To avoid this problem all you need to do is append a single quote (') before your date . i.e '02/06/2009 should be set as text to excel and you will see the date in correct format.

For more solutions to day to day ASP.NET problems , Subscribe here or click here to get updates via email

11/27/2009

Dear Users

Thanks for reading Technade. Lot of things keep my day busy these days. I dont find much time to write a article on technade (absolutely sorry about it). I will try to get atleast one article posted on the blog everyday in the coming month.Please bear with us in the mean time.

Note : I am looking for guest authors from my niche area ( Technology ).If you are interested, please let me know.

Prerequisite : Sound knowledge of Windows and PC's
Good English Knowledge.

Yours
Subhash V

8/07/2009

How to call a WCF service using web service task in SSIS ? WCF and SSIS 2005

A day back I had a requirement where I had to write a simple web service which generates a Excel Report and had to get it executed as a daily job . So I thought of writing a SSIS package which will call a web service . But I am much into learning WCF ( Windows Communication Foundation ) these days .So I thought why dont I create a WCF service instead of Web service !! So I ended up creating a WCF service.

Now the question is Can I call a WCF service using Web service task in SSIS 2005 ?

The answer is Yes you can . All you have to do is follow the steps below .

Before we create a package , we need to make few changes to the Windows Communication foundation host and client so that we can make things work .

Make the following changes to the web.config of WCF host :

There will be a entry called as Bindings in the System.servicemodel tag in web.config of WCF host . You have to change the type of bindings in it as follows .
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ReportService"
closeTimeout="00:05:00"
openTimeout="00:05:00"
receiveTimeout="00:05:00"
sendTimeout="00:05:00"
maxBufferPoolSize="524288"
maxReceivedMessageSize="2147483647">
<readerQuotas
maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>


By default it will be wsHttpBindings in a WCF service . But in a web service it used to be basic Http Binding and web service task has been configured to work only with basic HTTP binding in SSIS 2005 . Since WCF service supports communication over different protocols , we can always set bindings and achieve the required functionality .

If your web service is also consumed by your web application or something , then you need to configure its web.config as below to enable it use the same binding (BasicHttp) which host exposes .

<bindings>
<basicHttpBinding >
<binding name="BasicHttpBinding_MPCService"
closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00"
sendTimeout="00:01:00"
allowCookies="false"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
messageEncoding="Text"
textEncoding="utf-8"
useDefaultWebProxy="true">
<readerQuotas
maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>



If you observe the web.config entries , you can observe maxDepth ,maxContentstringLength and other attributes being set to 2147483647 . This has been set as my output of webservice (Excel file ) was very large . You can remove them if you want .

Now lets create a SSIS package using BIDS 2005 .
  • The first thing you have to do is setup your HTTP connection using New Connection Wizard .
  • Now save the WSDL of the service in a local path . You can get the WSDL by using the link you have used as server URL in the HTTP connection manager above . The link will be something like http://localhost/WCFservice/ReportService.svc?wsdl.Save it as [Filename].wsdl .
  • Now add a web service task from the toolbox of your Business Intelligence development studio ( BIDS ) .
  • Open the Properties of your webservice task and configure it as below.


  • Web Service Task Configuration :In the HTTP connection , select the HTTP connection you added above .
  • In the WSDL File field , give the local path to where you have stored your WSDL file .
  • Set OverwriteWSDLFile to true and click on download WSDL .
  • Now click on input in the left side pane .
  • In the input screen you can select your service and the corresponding Web methods .
  • Select the required one and go to output option .
  • In the output screen, you can set output type to either some variable or file connection as per your requirement .
  • Now click on OK and you are done with configuring your SSIS package to call a WCF service .
Now you execute your task and you can see it working . If you still have any problems feel free to contact me .

For more solutions to day to day ASP.NET problems , Subscribe here or click here to get updates via email .

6/28/2009

A-Squared Emergency USB Stick - Portable USB Malware Protection


Cyber Security is a great warfare. There is always a race here between malware developers and security vendors. And by the very nature of the security software development process, malware developers are always ahead of the security software.

Present day malware have a characteristic that once they are able to enter your computer, they try to block you every mechanism, which can try to restrict their evil designs. They will try to disable your antivirus suites, they will change your browser homepages, they will try to modify your hosts file so that you are not able to access the security vendor websites and other forums, they will disable the update process of your security software and things like that.

There are fair chances that if your antivirus definitions are not updated, your antivirus installation will be crippled and handicapped beside the damage to your other applications.

In such a situation, you might need a security tool, which is ready to combat the malware, and is ready with the latest virus definitions.

A-Squared Emergency USB Stick is one such tool. It is a free tool, which from the reputed security software vendor EMSI. It is basically a combination of two security tools.

  1. a-squared Free: With a-squared Free you have got the powerful a-squared Scanner including graphical user interface. Search the infected PC for Trojans, Spyware, Adware, Worms, Dialers, Keyloggers and other malign programs.
  2. a-squared Command line Scanner: This scanner contains the same functionality as a-squared Free but without a graphical user interface. The commandline tool is made for professional users and can be used perfectly for batch jobs.


This tool is specially suited for the cases, when the GUI interface of your installed antivirus gets disabled and you cannot use it for any meaningful purpose. A command line tool is very useful in such a situation.

[Download A-Squared Emergency USB Stick]

[This is a Guest Post from Silki Garg, who enjoys writing about Internet and PC Security Issues. Check out her latest articles on ClamWin Portable Virus Remover and Windows Security Options Tool WinPatrol.]

Microsoft announces pricing plans for Windows 7 : 50 % discount on Windows 7


Software giant Microsoft has announced the pricing plans for its new operating system Windows 7 .The prices for Windows 7 in United states are as follows :



1. Windows 7 Home Premium (Upgrade): $119.99
2. Windows 7 Professional (Upgrade): $199.99
3. Windows 7 Ultimate (Upgrade): $219.99



And the prices for the Windows 7 full package are:



1. Windows 7 Home Premium (Full): $199.99
2. Windows 7 Professional (Full): $299.99
3. Windows 7 Ultimate (Full): $319.99



The Redmond giant also says that customers who purchase new computers before Windows 7 goes on sale will get free upgrades once it is released . The home basic version of Vista wont be eligible for upgrade. The company also offers customerswho live in the United States and other select markets the opportunity to preorder Windows 7 starting yesterday at a discount of 50 %, which means that in the United States, you can preorder Windows 7 Home Premium for $50 or Windows 7 Professional for $100 till supplies last.



The offer ends July 11 in the United States and Canada, and July 5 in Japan. Customers in the United Kingdom, France and Germany can preorder theirs July 15 to Aug. 14. For all the fine print concerning the offer, click here or here.


The new Operating System , Microsoft Windows 7 will officially hit the stores on Oct. 22.