Techaray

Shailendra Saxena's Technical Blog

Collation issue : Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Chinese_PRC_CI_AI" in the equal to operation.

clock November 22, 2012 05:56 by author ShailendraSaxena

Hi,

I faces issue Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Chinese_PRC_CI_AI" in the equal to operation.

My application is developed for English and Chinese language.One of my report was working fine in English server but on chinese server it was giving error.

Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Chinese_PRC_CI_AI" in the equal to operation.

I analysed the report and find out that there is error in my sp which is not returning the values.

then updated my sp and in where clause where i was comparing the values from the equal to operator.
i put collate Chinese_PRC_CI_AI on both side and worked well.

I hope it will be helpfull to you.



How to run you web application on specific port on localhost

clock November 3, 2012 23:00 by author ShailendraSaxena

 

Below are the steps

1.       Go to you web app and open property window.

2.       Change use dynamic port to false

3.       In port number type the port number you want to use. e.g. 1001.

Go to Project Properties and change as below.

Specific port and port No.

 

 

 



Singleton Design Pattern in .Net

clock November 3, 2012 09:50 by author ShailendraSaxena

 Introduction

In Singleton Design Pattern one class has only single instance of a class, and provide a global point of access to it.

No client can create an instance of the object from outside.

In a singleton class

1. Constructor is defined as private.

2. Method and instance as static.

Code Example

Create a C# Project name [Singleton] in Visual Studio 2010 and add a class named “Singleton” as below.

 

//Singleton.cs

 using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Windows.Forms;

 

namespace SingleTon

{

   public  class Singleton

{

 

   private static Singleton singleton;

   private Singleton() {} // private constructor

   public static Singleton CreateInstance() //Static Method

   {

      if (singleton == null)

      {

         singleton = new Singleton(); 

 

        

      }

      return singleton;

   }

}

}

 

In “Form1” of the project, write below code in form load event.

private void Form1_Load(object sender, EventArgs e)

        {

            Singleton ObjA = Singleton.CreateInstance();

            MessageBox.Show("SingletonClass Instance Created");

            Singleton ObjB = Singleton.CreateInstance();

          

            if (ObjA == ObjB)

            {

              

                MessageBox.Show("ObjA and ObjB Now having Same reference");

            }

        }

When to use Singleton

A singleton should be used when managing access to a resource which is shared by the whole application and it would be destructive to potentially have multiple instances of the same class.

Can be used while logging and connection pooling etc. in real time application.



Search

Calendar

<<  August 2017  >>
SuMoTuWeThFrSa
303112345
6789101112
13141516171819
20212223242526
272829303112
3456789

Archive

Tags

Categories


Visitors

FlagCounter

Flag Counter

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017

Sign In