Posts

Showing posts from July, 2013

Solution for failed to create Configuration Database for MOSS 2007 on Windows Server 2003

Image
some time when after you install and try to run the configuration wizard you will get an error message like this. then you know idea to what to do. you go and check your SQL Server and Application pool, Services in the server and so many other things. but you can overcome this problem easily.  Solution check you have installed Microsoft office 2010 in your server. if so then uninstalled and re run the wizard. then it'll work smoothly. 

Walkthrough Func type in C#

Image
from my last post I talked about the Func type and Action type. so today also i'm going to go through that topic and show you a sample code of func type usage. Code is pretty simple and no need to explain in detail. go through it then you will understand that easily and also you'll get an idea about the Func type. of easy of demonstration i put all the method to program.cs class in console application project. Enums and Dictionary variables /// <summary> /// The dictionary to hold method names /// </summary> private static Dictionary<CalculationType, Func<int, int, int>> methodDictionary; /// <summary> /// CalculationType /// </summary> internal enum CalculationType { Add, Multiply, Subtract, Divide } Common Calculation methods /// <summary> /// Adds Two values and return the answer. /// </summar...

C# Func and Action Type Example

Image
From this article I'm going to show simple example of Func and Action Type in C#. before go to the coding let's see what's Func and what is Action. so in the previous article we talked about the delegates. so these func and Action types are also derived from delegate type. 1. Func  Func handle method with parameters therefore we say Func is Parameterized type. in Func we specified number and kind of parameters and what should be the return type. And Func type provides a way to store anonymous methods in generalized and simple way.  you can find more information about Func here . 2. Action  Action object return no value. so this is similar to void method in C# and we can use Action type to handle Void methods. Action method can found in System namespace. You can find more information about Action here . so let's go to a sample code and try to get idea about these concepts. class Program { /// <summary...

C# Delegates for Beginners

Image
Delegate is a type that can reference to a method. once delegate is assigned to a method it can behave exactly like that method. so now I'm going to show you a simple example to demonstrate how delegate is work.  so let's go to the code and check that one. I'll explain things while i show you the code. okay. To demonstrate this i created a console application named demo. now we need a simple class to add our calculation methods. so go to your project and create a class name Calculation and add following method to your class  1. C alculation Class /// <summary> /// Calculation Class /// </summary> public class Calculation { #region Public Methods /// <summary> /// Adds two values /// </summary> /// <param name="value1">The value1.</param> /// <param name="value2">The value2.</param> /// <returns></returns> ...

Command Design Pattern

Image
Today I'm going to show you another important design pattern which we can use for recurring  problems. Main intent of this design pattern are mention below  Encapsulate a request as an object, thereby letting you parameterize clients with different request, queue or log request, and support undoable operations. Promote "Invocation of a method on an object" to full object status . Promote  An object-oriented callback  You already know i'm kind of lazy person when comes to documentation as well as blogging lengthy articles he heee. so if you guys like to know more information about command pattern, please refer here . Okay let's try to implement this using a simple example. so today i'm going to create a simple calculator ( Windows form project) and it can do few operations such as add, subtract and multiplication. so let's see the code segment and then you will understand how this pattern works. 1. Ac...

Factory Design Pattern

Image
Today I'm going to show you a very simple code segment to understand the one of the most used design pattern in the IT word. As I mention on the Title it's Factory pattern and the main intent of this pattern is to create objects without exposing to the client and also refers to newly created object through a common interface. in this article I'm not going to explain you the theoretical parts. so I'm going to show you sample code now. here I use the famous Pizza story to come up with a solution. and you can get more details about this pattern here . 1. Create a IFactory Interface  /// <summary> /// IFactory Interface /// </summary> public interface IFactory { /// <summary> /// Pizza Create Method /// </summary> /// <returns></returns> string CreatePizza(); } 2. Create Domino's Class and Implement it using    IFactory Interface  /// ...

Deep dive into OpenXML Part 2

Image
So In the Deep dive in to OpenXML part 1 I showed you the common methods which we can use to generate an excel file. but most of you are not aware to use those methods so today i'm going to show you the way to use those method and generate an excel file.  for this exercise use a Console application project. Excel File Generator Class /// <summary> /// File Generator Class /// </summary> class FileGenerator { #region Variable Declaration /// <summary> /// Column Span for Grouping /// </summary> private const string ColSpanLine = "1:4"; private const string SheetName = "Sample"; #endregion #region Public Methods /// <summary> /// Generates the report. /// </summary> /// <param name="reportList">The report list.</param> /// <param name="fileLocation">Th...