WCF exception: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.

Security settings for this service require ‘Anonymous’ Authentication but it is not enabled for the IIS application that hosts this service. This error occurred, because I had an endpoint configured in mine wcf service web.config with a identity tag, as shown below: <endpoint address="" binding="wsHttpBinding" contract="Tpp.Pegaso.MaintenanceService.IMaintenanceService"> <identity> <dns value="localhost"/> </identity> …

ASP .NET error: No protocol binding matches the given address 'http://…./ImportService.svc'. Protocol bindings are configured at the Site level in IIS or WAS configuration.

I got the asp .net error: No protocol binding matches the given address ‘http://…./ImportService.svc’. Protocol bindings are configured at the Site level in IIS or WAS configuration, because I did not do an iisreset after I changed the website binding (I added a hostheader).

Display used and free space with TSQL in Microsoft SQL Server 2008 mdf and ldf file

To calculate the "size", "used size in" and "free space in" a Microsoft SQL Server 2008 mdf or ldf file use: use mastergoselect name, cast((size/128.0) as int) as TotalSpaceInMB, cast((cast(fileproperty(name, ‘SpaceUsed’) as int)/128.0) as int) as UsedSpaceInMB, cast((size/128.0 – cast(fileproperty(name, ‘SpaceUsed’) AS int)/128.0) as int) as FreeSpaceInMB from sys.database_files Result …

Microsoft Office Sharepoint Server Automaticly sign-on with Windows Username and password

http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/MS-SharePoint/Q_22988684.html in IE, go to Internet options.  go to the security tab.  highlight Local Intranet and then click Custom Level.  at the bottom of the settings, make sure "automatic logon with current user name and password" is selected.  then click ok.  make sure Local Intranet is still highlighted and click …

Shortcut Collapse project or projects in the Solution Explorer Microsoft Visual Studio 2008

The standard windows keyboard shortcuts for expanding and collapsing treeviews are: Numeric Keypad *: Expands everything under the current selection Numeric Keypad +: Expands the current selection Numeric Keypad -: Collapses the current selection. RIGHT ARROW: Expands the current selection if it is not expanded, otherwise goes to the first …

Month abbreviation in C#

If you want to use dates in C# like 20-mar-2009, you have to know the month abbreviation, for en-US these are: Console.WriteLine(string.Format("{0:MMM}", DateTime.ParseExact("20080101", "yyyyMMdd", newCultureInfo( "en-US", false)))); Console.WriteLine(string.Format("{0:MMM}", DateTime.ParseExact("20080201", "yyyyMMdd", newCultureInfo("en-US", false)))); Console.WriteLine(string.Format("{0:MMM}", DateTime.ParseExact("20080301", "yyyyMMdd", newCultureInfo("en-US", false)))); Console.WriteLine(string.Format("{0:MMM}", DateTime.ParseExact("20080401", "yyyyMMdd", newCultureInfo("en-US", false)))); Console.WriteLine(string.Format("{0:MMM}", DateTime.ParseExact("20080501", "yyyyMMdd", newCultureInfo("en-US", false)))); Console.WriteLine(string.Format("{0:MMM}", DateTime.ParseExact("20080601", "yyyyMMdd", …

Convert byte [] array to hex string

/// <summary> /// Convert a byte array to a hex string /// </summary> /// <param name="bytes"></param> /// <returns> /// Converted byte array to string /// null, when bytes == null /// </returns> public string ConvertByteArrayToString(byte[] bytes) { string result = null; // Convert byte array to string, when bytes is …

Insert image with TSQL and a hex string

You can insert an image from t-sql script, if you use the hex string notation: The next line will insert an image representing a "check mark" into the database. In a table [Test] with a column [Image]. insert     [Test] values(0x89504E470D0A1A0A0000000D49484452000000100000001008060000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18 F0BFC6105000000206348524D00007A26000080840000FA00000080E8000075300000EA6000003A98000017709CBA513C000001B649444154384FA5926B 2F42711CC77924E7BDB8970873DB58AE4B11399CC8359A2754A7D23D86B91C0FCDFD3A5B68AEC36C1E2AC9780DE64D485FFFCEA68D329AB39D87DFCBEFF 3FFA60248F9D71735F8CF9FB458B9D9C035ADD4D83E43933268D9A8E774271A0C1E319072E52C7FFE5FEB37AFD771C3C7DD987F72C27367827A578952778 1F94F068AB55A4EEB5363F6D18199471BBAF65A51E62984C42A14C40CB4D74C65FF05DDFBBD917CB5968B569E0ED93015B2F2C9254E71B8703C4F103B417BC 514F79DD3AFECAD0E8CB779E4D384C0E2060E3B31F5308EC9070B989D16143BF2C305965C5ECC1B0C5E7656F59DB5BF4CF859CC86EC50EDCAC204D6886C5 93AD37F4063226881E79E45C7B602457651586CCE89897983DE5355BAC6D706FDCD10169EDDF0F84DD01EABA13BD5C0E537C2796F04BD2587C4267CCF37 7D15C74EA0F7E5144986EE4CC3DF391934C311D0C3E1D743B5D914851511B1D95F92E376406051B225297ABCED70060CB0DE8DA26D5D06022B223266251 4C7ED40BA584155CF9591CA0A28D71A4160458486CC1FC5098744DE972A71894160BDE5E933D37E1B5AC221115854EE58C6AFE2A4A6FC53930F93387C6A 1968F12D0000000049454E44AE426082) …

C# convert a BitMap to Byte[]

/// <summary> /// Covert a bitmap to a byte array /// </summary> /// <param name="bitmap"></param> /// <returns> /// byte array, when bitmap could be converted /// null, when bitmap is null /// null, when bitmap could not be converted to byte array /// </returns> public byte[] ConvertBitMapToByteArray(Bitmap bitmap) { byte[] …