=SUBSTITUTE(“How to remove space between world in a cell”,” “,””) Output: HowtoremovespacebetweenworldinaCell Read more →
Month: July 2015
Assignment Operator
DECLARE @test INT; Truncate table #TableName SET @test = 1; SET @a = ( SELECT TableNameID FROM #TableName where (1=2)); Print @a — result NULL SET @test = 1; SELECT @a=TableNameID FROM #TableName where (1=2); Print @a — result 1 Read more →
windows.location navigation error
If beforeupload function is attached to windows and any event/ function changes the windows.location and we choose “Stay on this page” it will through error. We need to use try catch for the solution. binding beforunload event for page $(window).on(‘beforeunload’, function(e){ return “must” }); following code is solution for if we called ajax call and using callback with change windows… Read more →
create proxy instance in entity framework
DBContext = contextobject Entity= tablename/entiry name var obj= DBContext.Entity.Create(); DBContext.Entity.add(obj); then obj has all reference/navigation. var obj= new Entity(); DBContext.Entity.add(obj); then obj has not reference/navigation map. Read more →
Is form is durty
function GetFormData() { oForm.Add(‘span’, $(‘span:not(:disabled)’).toEnumerable().ToObject(“i=>i.attr(‘name’)”, “i=>(i.is(‘:disabled’)?”:i.text())”)); oForm.Add(‘input’, $(“input:not(:disabled)”).toEnumerable().ToObject(“i=>i.attr(‘name’)”, “i=>i.val()”)); } function isModifiedForm(au) { var oChangeForm = $.Enumerable.Empty().ToDictionary(); oChangeForm.Add(‘span’, $(‘span:not(:disabled)’).toEnumerable().ToObject(“i=>i.attr(‘name’)”, “i=>(i.is(‘:disabled’)?”:i.text())”)); oChangeForm.Add(‘input’, $(“input:not(:disabled)”).toEnumerable().Where(“i=>i.attr(‘name’)!=’tags’”).ToObject(“i=>i.attr(‘name’)”, “i=>i.val()”)); var tempEnumB=Enumerable.From(oChangeForm.Get(“input”)); var tempEnumA=Enumerable.From(oChangeForm.Get(“input”)); var NoofInputChanged = false; var NoofSpanChanged = false; var hasInputChanges = tempEnumB.Count() != tempEnumA.Count(); if (hasInputChanges) { NoofInputChanged = tempEnumB.Join(tempEnumA, “i=>i.Key”, “o=>o.Key”, “i,o=>{K:i.Key, IsEq:(i.value==o.value)}”).Where(“x=>x.IsEq==false”).Count(); } tempEnumB=Enumerable.From(oChangeForm.Get(“span”)); tempEnumA=Enumerable.From(oChangeForm.Get(“span”)); var hasSpanChanges =… Read more →
SQL Server Data Type Mappings
SQL Server Database Engine type .NET Framework type SqlDbType enumeration SqlDataReader SqlTypes typed accessor DbType enumeration SqlDataReader DbType typed accessor bigint Int64 BigInt GetSqlInt64 Int64 GetInt64 binary Byte[] VarBinary GetSqlBinary Binary GetBytes bit Boolean Bit GetSqlBoolean Boolean GetBoolean char String Char[] Char GetSqlString AnsiStringFixedLength, String GetString GetChars date (SQL Server 2008 and later) DateTime Date GetSqlDateTime Date GetDateTime datetime… Read more →
Delete from remote repository
$ git checkout master $ git pull $ git checkout -b branchName Delete and then re-create the branchName branch #this deletes your local copy of the branch $ git branch -d branchName #this deletes the branch from the remote repository $ git push origin : branchName $ git checkout master $ git pull $ git checkout -b branchName Read more →
reset last commit in Git
git reset –hard origin/master Read more →
Git Branch creation and point to remote repository
#Goto Master/origin Branch git checkout master #make sure you have the latest files git pull #create new branch in your local repository git checkout –b NewBranchName #create remote branch with tracking git push –u origin NewBranchName Read more →
Confirmation alert for page exist
$(document).ready(function(){ $(window).on(‘beforeunload’, function(e){ if(CheckFunctionForConfirmation()){ return ‘Are you sure you want to leave without saving?’; } }); }); Read more →