Thursday, August 8, 2013

asp .net code samples: css binding in Knockout js

asp .net code samples: css binding in Knockout js

In this article, I’m going to explain to css observable binding using knockout js  MVC 5. 

Here, I’m going to show/ hide div by observably...

For more details : www.code-sample.com/2013/08/css-binding-in-knockout-js.html


Tuesday, February 26, 2013

Select Column Comma Separated in SQL Server

-Example 1:

SELECT top 1
              STUFF ( ( SELECT ','+inTab.FIRST_NAME
                           FROM  crm.CONSUMERS inTab
                              FOR XML PATH(''),TYPE).value('.','VARCHAR(MAX)'),1 ,1,SPACE(0)) as ConsumersListWithComms
FROM crm.CONSUMERS OutTab


--Example 2:

SELECT TOP 1 (SELECT inTab.FIRST_NAME+','
                     FROM CRM.CONSUMERS inTab FOR XML PATH(''))
                     AS ConsumersListWithComms
FROM CRM.CONSUMERS outTab

Monday, February 25, 2013

Constant key:
1.      Const is by default static but cannot mark as static.
For exp:   public static const int _strConst = 10; //error
                 //constant cannot mark static.
 public const int _strConst = 10; // good

    public class classConst
    {
        public const int _strConst = 1;

        static void Main(string[] args)
        {}
     }

2. Const key values must be initializing at the declaration time only.
3. Const key values is initializing at compile time.
4.  Const Key values cannot change at the Run time.
                       
Readonly key:
1.      In Readonly key marked as static.
            For exp:   public static readonly int _strReadOnly ;// good
            public readonly int _strReadOnly ;// good
            public readonly int _strReadOnly=10 ;// good

    public class ClassReadOnly
    {       
        public static readonly int _strReadOnly ;
        public ConstReadOnly()
        {
             _strReadOnly = 10;
        }
        static void Main(string[] args)
        {}
     }
2.      Readonly key is initializing maybe at the declaration time, in the constructor, in the web config.
3.      Readonly values is initializing at Run time.
4.      Readonly values can be changed at the Run time.