Monday, January 24, 2011

Drop down in XSLT

ADJUSTMENT (CREDIT) CORRECTION ERROR ERROR OFFSET (CREDIT) SPECIAL FEES LEVIED OTHER

Thursday, July 29, 2010

WCF Client Sample code

static void Main(string[] args)
{
using (WCFServiceClient client = new WCFServiceClient("WSDualHttpBinding_IWCFService"))
{
string output = client.MyOperation1("Manoj");
Console.WriteLine(output);
DataContract1 dc = new DataContract1();
dc.FirstName = "Shankar";
dc.LastName = "Mahadevan";
output = client.MyOperation2(dc);
Console.WriteLine(output);
Console.ReadLine();
}

Configuration of WCF in Host

Service.cs
[OperationContract]
[System.ServiceModel.Web.WebGet(UriTemplate = "/MyOperation/MyOperation1/{myValue1}", ResponseFormat = System.ServiceModel.Web.WebMessageFormat.Json, BodyStyle = System.ServiceModel.Web.WebMessageBodyStyle.WrappedResponse)]

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, IncludeExceptionDetailInFaults = true)]

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]

Generating a proxy for the client
svcutil.exe /language:cs /out:generatedProxy.cs /config:app.config http://localhost:2409/WCF_Host/Service.svc

Configuration of webHttpBinding and wsDualHttpBinding

< ?xml version="1.0"?>
< configuration>
< system.serviceModel>
< serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
< behaviors>
< endpointBehaviors>
< behavior name="webHttpEnablingBehavior">
< webHttp />
< /behavior>
< /endpointBehaviors>
< serviceBehaviors>
< behavior name="webHttpEnablingBehavior">
< serviceMetadata httpGetEnabled="true"/>
< serviceDebug includeExceptionDetailInFaults="true" />
< /behavior>
< /serviceBehaviors>
< /behaviors>
< services>
< service name="WCFService" behaviorConfiguration="webHttpEnablingBehavior">
< endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
< endpoint address="" binding="webHttpBinding" bindingConfiguration="default" contract="IWCFService" behaviorConfiguration="webHttpEnablingBehavior" />
< endpoint address="MyOperation" binding="wsDualHttpBinding" bindingConfiguration="default" contract="IWCFService" />
< /service>
< /services>
< client />
< bindings>
< webHttpBinding>
< binding name="default" />
< /webHttpBinding>
< wsDualHttpBinding>
< binding name="default" />
< /wsDualHttpBinding>
< /bindings>
< /system.serviceModel>
< system.web>
< compilation debug="true"/>
< /system.web>
< /configuration>

Monday, May 24, 2010

Using CSS with Inline Images

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> .clip { position: absolute; top: 0; left: 0; } .pos-1 { clip:rect(0 48px 48px 0); } .pos-2 { clip:rect(0 96px 48px 48px); left: -48px; } .pos-3 { clip:rect(48px 48px 96px 0); top: -48px; } .pos-4 { clip:rect(48px 96px 96px 48px); top: -48px;left: -48px; } .clipwrapper { position: relative; height: 48px; width: 48px; } </style> <title></title> </head> <body> <div class="clipwrapper"> <img src="Images/arrow-sprite.png" alt="arrow" class="clip pos-1" /> </div> </body> </html>

Wednesday, May 5, 2010

SQL Server built in functions

1. First day of the week
select @@DateFirst output: 7 - Monday , 1 - Sunday
Set dateFirst 1
To see the permissions in the database.
select * from fn_my_permissions('null','database')
SELECT DISTINCT class_desc FROM fn_builtin_permissions(default) ORDER BY class_desc;
GO

Wednesday, April 7, 2010

Design patterns

One way is to call carpenter and let him take the measurements and then get you the door. --- factory method
Second way is to go to shop which sells doors and get the one which fits your requirements. --- abstract factory
Tracking a Session counter creates a single object - Singleton pattern