Posts

Code Design - Choosing Abstract or Interface - Level 100

More often we wont get a chance to work on these aspects in early stage of your career. Even at the time of mid career getting a work related to API designing/Development is bit difficult. Unless you have a very good mentor in your initial career you will never get to know the real time. And you will end up in theoretical knowledge if you are computers academics. Others need to witness nightmares :-) Always try to implement good design in your day to day work. Never try to concentrate on these concepts for the matter of career growth. Only the passion to write a good code lets you to remember things. Design patterns are not meant for only senior programmers. You need to have a little bit knowledge on nitty-gritty of OOP/OOD concepts. And I need to say that continuous practice only lets you to excel further in OOP/OOD concepts irrespective of your experience levels. Here are some basic recommendations to help you to decide whether to use an interface or an abstract class to provid

C# - Finding connection string - Easy way

Most of the times we used to face difficulty while creating connection strings in our C# applications and especially when you are working in data intensive apps. I used to do lots of permutations and combinations (due to drivers installed) to find out the proper connection string in my initial career. Here I would like to explain easiest way and proper manner to test the connection ahead to actual usage. For database connections in C# apps you often need to supply an ADO Connection String. Here is a tip how to generate such string very easily. (Windows only) Go to your desktop  Right click and choose NEW/Microsoft Data Link - if you don't have this option on your menu, just choose NEW/Text Document  If you have make a new text file - change the file extension from .txt to .udl  Double click on the new file - you will see now the Microsoft Connection wizard (Data Link Properties)  Choose your database driver and connection properties  Test the connection  Choose OK to

Generics in C# - Straight

In programming, generics are also known as parametrized types or parametric polymorphism . Generics have been added to the .Net framework since version 2.0. They introduce the type parameter T to methods, classes (or types) and interfaces. There is a documented conversation about Generics in C#, Java and C++ with Anders Hejlsberg (The original author of Turbo Pascal , the chief architect of Delphi and the current lead architect of C#). With using generics, your code will become reusable, type safe (and strongly-typed) and will have a better performance at run-time since, when used properly, there will be zero cost for type casting or boxing/unboxing which in result will not introduce type conversion errors at runtime. The compiler of C# will be able to detect any problems of invalid casting at compile time. Reusability with generics means that you will be able to create a method or a class that can be reused with different types in several places. Now with generics you will be writin

A quick Utilities, Tips & Tricks for web dev only

​Hi,​ While doing some validatioons you want to validate character count. Then here is the link http://www.javascriptkit.com/script/script2/charcount.shtml Do you want to validate the CSS you wrote? Then here is the link http://jigsaw.w3.org/css-validator/#validate_by_input You want to decode or encode a character. Then here is the link http://www.base64decode.org/ Do you want to add days, months or years to a DATE? Then here is the link http://www.timeanddate.com/date/dateadd.html ​Tired of writing SQl and Do you love to work on LINQ but don't have a proper IDE? Then here is the link http://www.linqpad.net/ Do you want to format the CSS you wrote in your own standards? Then here is the llink http://www.lonniebest.com/FormatCSS/ ​Do you want to format XML, JSON, HTML, HTML5, RegEx or SQl or else any? Here is the link http://www.freeformatter.com/html-formatter.html​ Do you want to quickly write html, javascript and css and see how it behaves in browser? Then

How to avoid a CORS problem?

This summary is not available. Please click here to view the post.

My Learnings with current Mobility/Web market trend

Hi, First of all a big happy new year to all my visitors. Today I would like to share my learning about the current market trend as the winter is going to complete and all the market will start to bounce back in next 30-45 days. At the starting of my career I used to be in a big misconception like any fresher. I always think ASPX, PHP, JSP, CFM etc are far better than the plain HTML pages. I really felt painful to write plain prototype based html with javascrript. But now after seeing the market trends and mobility boom I realized the true strength & can confidently say it like HTML is far far away from any other above mentioned server based web technologies. In the coming future the only UI we will see with is developed only with HTML5. Question : So WHY previously we didn't concentrated on these things, Because HTML already there and which works only via http protocol means we have web services etc to work on. Answer : Previously the handshakes will be based on SOA

Implementing impersonation in c#

Hi, Today am going to explain about the implementation of impersonation. This code we can use in many contexts like web, windows, services etc. The main things to be a pr requisite are user context should have a proper permissions and necessary references were made.( Please see the ‘usings’ here in the snippet) This impersonation is needed mainly in few cases like to do some server side functionality means printing, network printing accessing, checking available printers, IO operations, etc all comes under particular user context. This thing needs to be done in many cases as the IIS application runs under very less privileges. So the IIS_User need to be impersonated before doing few operations. Here am attaching the complete class for making it more simpler to benefit you people. You just need to copy this class in to your project and use a snippet as like this using (Impersonation impersonation = new Impersonation(impersonationUsername, impersonationDomainName, impersonationP