I am using the code below to download file.


WebClient myWebClient = new WebClient();
myWebClient.DownloadFile(myStringWebResource, fileName);
But suddenly I have started to get 504 error. After adding header, the error has gone.
myWebClient.Headers["User-Agent"] = "Mozilla/4.0 (Compatible; Windows NT 5.1; MSIE 6.0) (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
When I try to create a new appointment using EWS Managed API, I get the following error.


The request failed schema validation: The element 'OptionalAttendees' in namespace 'http://schemas.microsoft.com/exchange/services/2006/types' has incomplete content. List of possible elements expected: 'Attendee' in namespace 'http://schemas.microsoft.com/exchange/services/2006/types'.

When I add an optional attendee it works but I do not need any optional attendee.
I tried
appointment.OptionalAttendees.Clear();
but no help. But removing it by using

public readonly static ExtendedPropertyDefinition PidLidOptionalAttendees = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Meeting, 0x00000007, MapiPropertyType.String);
appointment.RemoveExtendedProperty(PidLidOptionalAttendees);
solved my problem.
Using Count (Over Partition by) decreases the performance. Be careful before using this. I had to change these statements because of the performance problem.
I have an application using Ms Word for spell checking. The application impersonates an admin account. The application runs when the specified account is logged on the server. But when the account is not logged on I receive " (Exception from HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER))" error.

I solved the problem as following:

Created a new pool for the application.
Set the identity specified in the web config.
Set load profile true.

Notes:
I could not set the security because the MS Word is not listed in the dcom config. I could add it to there but I did not want to modify the registry.So I had to do as above.

Word Automation

by on 2:30 PM
I have an application using Ms Word for spell checking. The application impersonates an admin account. The application runs when the specif...
When adding a CustomControl dynamically, you receive "Unable to find control id referenced by the 'ControlToCompare' property" error.

I search for the Internet and found no solution. I achieved this bu using JavaScript and jQuery.

In page add a startup script. (I don't like Page.RegisterStartupScript)

$(document).ready(function() {
<%= this.StartUpScript %>
});
In code behind

CompareValidator cv = new CompareValidator();
cv.ID = "customvalidatorid";
cv.ValueToCompare ="Whatever"; // You must set a value. Else, you get an error.
this.StartUpScript += String.Format("document.getElementById(\"{0}\").controltovalidate=\"{1}\";", cv.ClientID, YourControlToCompareId);
this.StartUpScript += String.Format("document.getElementById(\"{0}\").removeAttribute(\"valuetocompare\");", cv.ClientID);
That's it!
Aspose Barcode installer requires administrative permissions to be installed. However, "Run as administrator" does not appear in the context menu. To achieve this, start a new command prompt with "Run as Administrator" and run the installer by entering the path of it.

Reference :
http://ask-leo.com/how_do_i_install_an_msi_file_that_requires_administrative_privileges_in_windows_vista.html
This week, I have upgraded to Windows 7. I have spent hours to run VS 2003 on my computer. You should the follow this article in the specified order http://blogs.iis.net/bills/archive/2008/06/02/installing-asp-net-1-1-with-iis7-on-vista-and-windows-2008.aspx. After that, to run VS 2003 successfully follow the instructions in the following article http://technikhil.wordpress.com/2010/01/12/visual-studio-2003-and-windows-7-can-get-along-really/. For IIS modification http://blogs.iis.net/wonyoo/archive/2009/06/18/workaround-running-asp-net-1-1-on-vista-sp2-ws08-sp2.aspx.