Monday, 13 April 2015

What is the difference between jquery.size() and jquery.length

jquery.size() and jquery.length both returns the number of element found in the object. But, jquery.length is faster than jquery.size() because size() is a method but length is a property .

jQuery .size() method returns number of element in the object. But it is not preferred to use the size()method as jQuery provide .length property and which does the same thing. But the .length property is preferred because it does not have the overhead of a function call. 

Difference Between Constant and ReadOnly and Static

Constant

Constant fields or local variables must be assigned a value at the time of declaration and after that they cannot be modified. By default constant are static, hence you cannot define a constant type as static.

ReadOnly

A readonly field can be initialized either at the time of declaration or with in the constructor of same class. Therefore, readonly fields can be used for run-time constants.

Static

The static keyword is used to specify a static member, which means static members are common to all the objects and they do not tied to a specific object.

Saturday, 4 April 2015

The maximum string content length quota (8192) has been exceeded while reading XML data.

Unhandled Exception: System.ServiceModel.CommunicationException: Error in deserializing body of reply message for operation ‘GetData’. The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.

--------------------------------------------------------------------------------------------------------------------------
Change in to the web.config file
--------------------------------------------------------------------------------------------------------------------------
<bindings>
      <basicHttpBinding>
        <binding>
          <readerQuotas maxStringContentLength=”2147483647″/>
        </binding>
      </basicHttpBinding>
</bindings>

Wednesday, 1 April 2015

Multiple Inheritance in c#


C# does not support multiple inheritance. However, you can use interfaces to implement multiple inheritance. The following program demonstrates this:


namespace MultipleInheritance
{
class A
{
public void disp()
{
Console.WriteLine("disp() method of Class A");
}
}

interface First
{
void mno();
}

interface Second
{
void pqr();
}

class Z:A,First,Second
{
public void mno()
{
console.WriteLine("mno() method is overridden.");
}
public void pqr()
{
console.WriteLine("pqr() method is overridden.");
}

}
}