Skip to main content

Posts

I Like Google Flintstone’s image

I like this Flintstone’s 50th Anniversary image of Google. Very creative and attractive... More info ...

Understand how things are coupled

Problem This problem was to add new filtering for one of already completed search scenario as well as another scenario. The search part is completely had been built using dynamic SQL. There for decided to build generic method which can used by all the scenario with the intension of reusability. Implemented filtering with the design pattern. ok.. Fine..Everything fine...But last moment find another placed which used this filtering which is tightly couple with the another SP..So couldn’t use this newly implemented method..Cant help...Had to written that filtering inside the SP. In this problem not much harm raised. We couldn’t achieve reusability because of tightly couple module. Mistake Missed one of the affected scenarios of the filtering. Lesson learned Before getting into a decision we need to identify the all the affected paths those areas already exist. And also need to understand how much each of them couple with other modules and SPs... Anyway got chance to improve my...

Integration

My next task will be the integration of a project which has two versions. Today i started working on it . Finished outline part and hope to identify the common mistakes we have done. So next post will be on highlighting the practices we should follow .

LIKE in sp_executesql

If somebody wants to use LIKE in sp_executesql if you use syntax as follows it will give an error. Wrong Syntax: LIKE N''%'' @variableName ''%'' Error message received; Msg 102, Level 15, State 1, Line 24 Incorrect syntax near '%'. Correct Syntax: LIKE N''%'' + @variableName + ''%'' Have to double the quotes as well as '+' marks around the variable.

Session Sharing

Recently i had a issue like this; if same page opened using different tabs in the browser and trying to save then the changes are done to one page is effect to other page . Finally found it is because of the session sharing problem in the browser. Could be able to overcome this problem using view state in the my scenario. But had to work lot..;-)

Add ready Only attribute

If you want to toggle read-only attribute in a textbox you cant do it as follows. //This will make the textbox read only . textBoz.Attributes["readonly"] = "true"; //This will not remove read only from the text box. textBoz.Attributes["readonly"] = "false"; Solution :- //This will make the textbox read only . textBoz.Attributes["readonly"] = "true"; //This will remove read only from the text box. txtAbn.Attributes.Remove("readOnly");

Get distinct

If you want to user LINQ distinct have to override IEquatable .Equals method. Rather using this it can be easily achieved like this ; var distinctItems = items .GroupBy(x => x.PropertyToCompare) .Select(x => x.First());