code for reverse string in c# and find duplicate record in jquery

static string reverse(string ss) { string[] strArray = ss.Split(‘ ‘) ; string revs=””; //int i = strArray.Length; StringBuilder sb = new StringBuilder(); for (int i = 0; i < strArray.Length; i++)   { string ty = string.Join(“”,strArray[i].Reverse().ToArray()); //            string firstLetter = strArray[i].Substring(0, 1); string firstLetter = ty.Substring(0, 1); //string secondPart = strArray[i].Substring(strArray[i].Length -2 ,0); string secondPart = ty.Substring(1);   sb.Append(firstLetter.ToUpper()… Read more →

Event preventDefault and stopPropagation difference

Event preventDefault: The event.preventDefault() method stops the default action of an element from happening. For example: Prevent a submit button from submitting a form Prevent a link from following the URL Event stopPropagation : The event.stopPropagation() method stops the bubbling of an event to parent elements, preventing any parent event handlers from being executed. -following link to get more about this event— http://www.jquery4u.com/function-demos/index.php?function=preventdefault#… Read more →

Important HR Questions

Why did you resign from your previous job? I resign from my previous job because of my experience that I have and The salary was not so as my experience and my skills but I will be always thankful to my previous company there I lean how to keep calm at stressed position, how to complete task on time etc.… Read more →

Dynamic Pivot Table

DECLARE @DynamicPivotQuery AS NVARCHAR(MAX) DECLARE @ColumnName AS NVARCHAR(MAX) –Get distinct values of the PIVOT Column SELECT @ColumnName= ISNULL(@ColumnName + ‘,’,”) + QUOTENAME(tablecolumn) FROM (SELECT DISTINCT tablecolumn FROM tableName) AS Courses –Prepare the PIVOT query using the dynamic SET @DynamicPivotQuery = N’SELECT Year, ‘ + @ColumnName + ‘ FROM tableName PIVOT(SUM(ColumnName) FOR columnName IN (‘ + @ColumnName + ‘)) AS PVTTable’… Read more →

IEnumerable VS IQueryable

IEnumerable IEnumerable exists in System.Collections Namespace. IEnumerable can move forward only over a collection, it can’t move backward and between the items. IEnumerable is best to query data from in-memory collections like List, Array etc. While query data from database, IEnumerable execute select query on server side, load data in-memory on client side and then filter data. IEnumerable is suitable… Read more →

Difference between document.ready and window.onload or pageLoad

$(document).ready() Best for onetime initialization. Called as soon as DOM is ready; may called slightly before than pageLoad(). Cross browser compatible. Unable to re-attach the functionality to elements/controls of the page affected by partial postbacks. pageLoad() Not best for onetime initialization if used with UpdatePanel. Not Cross browser compatible. Best to re-attach the functionality to elements/controls of the page affected… Read more →

indexer

Indexers Indexers allow instances of a class or struct to be indexed just like arrays. Indexers resemble properties except that their accessors take parameters. class SampleCollection<T> {     // Declare an array to store the data elements.     private T[] arr = new T[100];     // Define the indexer, which will allow client code     // to use [] notation… Read more →

Covariance and Contravariance in Generics

In probability theory and statistics, covariance is a measure of how much two random variables change together. If the greater values of one variable mainly correspond with the greater values of the other variable, and the same holds for the smaller values, i.e., the variables tend to show similar behavior, the covariance is positive.In the opposite case, when the greater… Read more →

Create Reference file for WCF and use manually

Run svcutil.exe serviceurl Generate Service files  codefile.[cs/vb] and output.config config file required to merge with your web.config or app.config. add codefile in your project. add two reference : system.ServiceModel and system.runtime.serialization. now use service.   Read more →