Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
T

Tridip Bhattacharjee

@Tridip Bhattacharjee
About
Posts
689
Topics
544
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • C#: How to compare variables by value and reference type
    T Tridip Bhattacharjee

    i have a small confusion that when we compare like == or equal function then both does the same job. u have a very basic question here. see my program full code

    int x = 1000;
    int y = 1000;

        if (x == y)
            Console.WriteLine("Value is same");
        else
            Console.WriteLine("Value is not same");
    
        if (x.Equals(y))
            Console.WriteLine("Value is same");
        else
            Console.WriteLine("Value is not same");
    
        if (object.ReferenceEquals(x,y))
            Console.WriteLine("ref is same");
        else
            Console.WriteLine("ref is not same");
    
    
        string s1 = "Hello";
        string s2 = "Hello";
    
        if (s1 == s2)
            Console.WriteLine("Value is same");
        else
            Console.WriteLine("Value is not same");
    
        if (s1.Equals(s2))
            Console.WriteLine("Value is same");
        else
            Console.WriteLine("Value is not same");
    
        if (object.ReferenceEquals(s1, s2))
            Console.WriteLine("ref is same");
        else
            Console.WriteLine("ref is not same");
    

    i know that this kind of checking if (x == y) is based on value but when i use Equals function then i saw Equals is also work like == operator....am i right ? how to check the reference ?

    if (object.ReferenceEquals(x,y))
    Console.WriteLine("ref is same");
    else
    Console.WriteLine("ref is not same");

    i saw in this case else portion execute........why because different memory is allocated for x and y ? see more for string reference check

    if (object.ReferenceEquals(s1, s2))
    Console.WriteLine("ref is same");
    else
    Console.WriteLine("ref is not same");

    in this scenario s1 and s2 ref found same which is not clear to me because s1 and s2 ref should be different because two are different variable so how s1 and s2 reference check become same? i like to know what are the best process to know value and reference is same or not whatever data type we use may be string or integer or float etc. please some one help me to understand this. one guy said string in dotnet is interned. what is the meaning of In .NET strings are interned ? interned or internal is same ? please discuss with a example just to clarify the meaning of string is interned in dotnet. thanks

    tbhattacharjee

    C# csharp question tutorial performance help

  • How to read & write data in queue in sql server
    T Tridip Bhattacharjee

    anyone can guide me that how to read & write data in queue in sql server. do i need to create queue first like table ? queue is persistent object in db like table ? please post a small example for read & write data in queue in sql server.

    tbhattacharjee

    Database tutorial database sql-server sysadmin data-structures

  • How to configure sql server profiler to see sql for my session only
    T Tridip Bhattacharjee

    i found it...here it is Under Trace properties > Events Selection tab > select show all columns. Now under column filters, you should see the USERNAME name. Give username in following fig. [screen shot image]

    tbhattacharjee

    ASP.NET database sql-server tutorial csharp sysadmin

  • How to configure sql server profiler to see sql for my session only
    T Tridip Bhattacharjee

    suppose i am working with SSMS and issuing many sql but sql server profiler will show all sql hiting database. so tell me how to configure sql server profiler to see my issued sql only. suppose i have developed c# apps which calling store proc or issuing in line sql. so tell me in this scenario how could i configure sql profiler to see what sql my desktop application is issuing ? guide me in details or get me a article link which help me to configure sql server profiler to see sql issued by my desktop apps. thanks

    tbhattacharjee

    ASP.NET database sql-server tutorial csharp sysadmin

  • How SSRS handle large data
    T Tridip Bhattacharjee

    when we develop report with ssrs then we can bind ssrs with sql server store procedure or c# data set. suppose sql server store procedure return 10,00,000 data and configure ssrs to show 50 data at a time in page. so my question is ssrs will fetch 10,00,000 data and store in memory but display 50 data at a time ? if this is true then report performance will be slower and huge memory will be required and block due to large data stored. so please tell me if anyone know how ssrs handle large data. how developer should develop ssrs when large data will be there. thanks

    tbhattacharjee

    ASP.NET sql-server performance question csharp database

  • Generic usage is not clear in one program
    T Tridip Bhattacharjee

    see this class code

    public class ShipperFactory
    {
    private static TShip Create()
    where TShip : IShip, // interface contract constraint
    new() // public parameter-less constructor constraint
    {
    return new TShip();
    }

        public static readonly IDictionary\> Creators =
            new Dictionary\>()
        {
            { Shipper.UPS, () => Create() },
            { Shipper.FedEx, () => Create() },
            { Shipper.Purolator, () => Create() }
        };
    
        public static IShip CreateInstance(Shipper enumModuleName)
        {
            return Creators\[enumModuleName\]();
        }
    }
    

    specially the below code is not clear where

    public static readonly IDictionary> Creators =
    new Dictionary>()
    {
    { Shipper.UPS, () => Create() },
    { Shipper.FedEx, () => Create() },
    { Shipper.Purolator, () => Create() }
    };

    1. see this line whose meaning is not clea. what is the meaning of Func ? new Dictionary>() Dictionary usage is not clear. help me to understand the code of Dictionary and as well as ShipperFactory class. it is required to use both interface and abstract class ? is it not redundant here ? here giving the full code which show how i am using ShipperFactory class calling like this way --------------------------

    private void btnUPS_Click(object sender, EventArgs e)
    {
    ShipperFactory.CreateInstance(Shipper.UPS).Ship();
    }

        private void btnFedEx\_Click(object sender, EventArgs e)
        {
            ShipperFactory.CreateInstance(Shipper.FedEx).Ship();
        }
    
        private void btnPurolator\_Click(object sender, EventArgs e)
        {
            ShipperFactory.CreateInstance(Shipper.Purolator).Ship();
        }
    
    public enum Shipper
    {
        UPS,
        FedEx,
        Purolator
    }
    
    public interface IShip
    {
        void Ship();
    }
    
    public abstract class ShipperBase : IShip
    {
        //Etc
        public abstract void Ship();
    
    }
    
    public class ShipperUPS : ShipperBase
    {
        public override void Ship()
        {
            //-- cod
    
    C# question css help

  • How to embed image when post in this site forum
    T Tridip Bhattacharjee

    would you explain what u try to say with example.

    tbhattacharjee

    Site Bugs / Suggestions tutorial help

  • Task.Wait() -Why??
    T Tridip Bhattacharjee

    this line

    MainAsync().GetAwaiter().GetResult();

    block the main thread. thanks

    tbhattacharjee

    C# csharp visual-studio wpf com design

  • How to embed image when post in this site forum
    T Tridip Bhattacharjee

    what you are trying to say. are you trying to say when we post anything in msdn forum then dedicated person there check the forum content and publish it. if it then i will say it is not right because i have seen many time i post content there and that appear instantly. please explain elaborately what u said here. thanks

    tbhattacharjee

    Site Bugs / Suggestions tutorial help

  • C#: When one should go for factory method pattern instead of factory pattern
    T Tridip Bhattacharjee

    i understand the both factory and factory method pattern. in factory pattern we create instance of my classed by another class function dynamically where i pass some parameter to another class function and based on that parameter another class function return right instance of class. in factory method pattern we have to proceed one further step. in factory method pattern subclass create instance of my class. i do not find a scenario where people has to go for factory method pattern. so please some one come with a scenario where normal factory pattern will not be used rather people prefer to use factory method pattern. here i am posting two set of code first one done by factory pattern and second one done by factory design pattern 1st set of code where factory pattern used

    public enum Shipper
    {
    UPS = 1,
    FedEx = 2,
    Purolator = 3
    }

    public interface IShip
    {
        void Ship();
    }
    
    public class ShipperPurolator : IShip
    {
        public void Ship()
        {
            //-- code logic to implement shipping method for Purolator
            MessageBox.Show("Purolator ship start");
        }
    }
    
    public class ShipperUPS : IShip
    {
        public void Ship()
        {
            //-- code logic to implement shipping method for Purolator
            MessageBox.Show("UPS ship start");
        }
    }
    
    public class ShipperFexEx : IShip
    {
        public void Ship()
        {
            //-- code logic to implement shipping method for Purolator
            MessageBox.Show("FedEx ship start");
        }
    }
    
    public class ShipperFactory
    {
        public static IShip CreateInstance(Shipper enumModuleName)
        {
            IShip objActivity = null;
    
            switch (enumModuleName)
            {
                case Shipper.UPS:
                    objActivity = new ShipperUPS();
                    break;
                case Shipper.FedEx:
                    objActivity = new ShipperFexEx();
                    break;
                case Shipper.Purolator:
                    objActivity = new ShipperPurolator();
                    break;
                default:
                    break;
            }
            return objActivity;
        }
    }
    

    Calling this way

    IShip objActivity = null;

        private void btnUPS\_Click(object sender, EventArgs e)
        {
            objActivity = ShipperFactory.CreateInstance(Shipper
    
    C# csharp design regex architecture

  • Factory pattern: issue with this definition "let subclass decide which class to instantiate."
    T Tridip Bhattacharjee

    after searching google for Factory pattern definition i found it is Factory pattern In Factory pattern, we create object without exposing the creation logic. In this pattern, an interface is used for creating an object, but let subclass decide which class to instantiate. The creation of object is done when it is required. The Factory method allows a class later instantiation to subclasses. see my Factory pattern related code and there is no subclass which instantiate class object rather i have class with a static function which create & return class object. so my question is that above definition is saying "subclass decide which class to instantiate" but in my code there is no subclass or child class rather a separate class create instance. is the above definition is for factory method pattern ? here is my code

    public enum Shipper
    {
    UPS = 1,
    FedEx = 2,
    Purolator = 3
    }

    public interface IShip
    {
        void Ship();
    }
    
    public class ShipperPurolator : IShip
    {
        public void Ship()
        {
            //-- code logic to implement shipping method for Purolator
            MessageBox.Show("Purolator ship start");
        }
    }
    
    public class ShipperUPS : IShip
    {
        public void Ship()
        {
            //-- code logic to implement shipping method for Purolator
            MessageBox.Show("UPS ship start");
        }
    }
    
    public class ShipperFexEx : IShip
    {
        public void Ship()
        {
            //-- code logic to implement shipping method for Purolator
            MessageBox.Show("FedEx ship start");
        }
    }
    
    public class ShipperFactory
    {
        public static IShip CreateInstance(Shipper enumModuleName)
        {
            IShip objActivity = null;
    
            switch (enumModuleName)
            {
                case Shipper.UPS:
                    objActivity = new ShipperUPS();
                    break;
                case Shipper.FedEx:
                    objActivity = new ShipperFexEx();
                    break;
                case Shipper.Purolator:
                    objActivity = new ShipperPurolator();
                    break;
                default:
                    break;
            }
            return objActivity;
        }
    }
    

    calling this way

    IShip objActivity = null;

        private void btnUPS\_Click(object sender, EventArgs e)
        {
    
    C# question algorithms regex help

  • How to embed image when post in this site forum
    T Tridip Bhattacharjee

    other reputed forum allow upload image in the post like forum.asp.net, msdn forum, stackoverflow etc to name a few. so how they are managing ? when people write article then they are embedding images then how they embed images when they compose article for this web site ? thanks

    tbhattacharjee

    Site Bugs / Suggestions tutorial help

  • How to embed image when post in this site forum
    T Tridip Bhattacharjee

    i do not know how to embed image when post in this site forum. is there any option available by which i can upload image from my pc to codeproject which will be displayed in post page after posting issue in this forum. looking for guide line. thanks

    tbhattacharjee

    Site Bugs / Suggestions tutorial help

  • in which scenario people use factory design patter
    T Tridip Bhattacharjee

    thanks for nice answer. can you please include a article link sir which show how i can use DbProviderFactory to connect sql server ,oracle, oldedb or use dsn to connect any db. thanks

    tbhattacharjee

    C# question com design regex architecture

  • in which scenario people use factory design patter
    T Tridip Bhattacharjee

    we know that in factory design patter we do not create object of any class directly rather create instance of a class by factory class. The client is an object that requires an instance of another object (the product) for some purpose. Rather than creating the product instance directly, the client delegates this responsibility to the factory. Once invoked, the factory creates a new instance of the product, passing it back to the client. Put simply, the client uses the factory to create an instance of the product. i read this article https://msdn.microsoft.com/en-us/library/ee817667.aspx?f=255&MSPPError=-2147217396 i am looking for a write up on factory design patter which show me when i need to create instance by factory because we can create instance directly but in factory design pattern instance create via factory. so what is the significance of factory design patter. so if anyone search google there is many article exist on factory design pattern but i do not find any article which tell me scenario when i will not create instance directly rather will create instance via factory. so please tell me few scenario with example code from where i can see when people would not prefer creating instance of any class directly rather will create instance via factory. thanks

    tbhattacharjee

    C# question com design regex architecture

  • What is the difference between hashing or encryption a data
    T Tridip Bhattacharjee

    What hashing does for which its value can not be reverse ?

    tbhattacharjee

    C# question algorithms security cryptography

  • What is the difference between hashing or encryption a data
    T Tridip Bhattacharjee
    1. please some one tell me difference between hashing or encryption a data. 2) i saw hashing also encrypt data which is not human readable and encryption does the same then why people think hashing is different from encryption ? 3) what hashing does ? 4) if we encrypt data then we can decrypt it too but if we hashing the data then can we reverse the process ? 5) if no then what algorithm hashing use that no one can reverse the data ? 6) give me two sample code to has data one will hash data without salt key and another one hash data with salt key. thanks

    tbhattacharjee

    C# question algorithms security cryptography

  • why github claim it is distributed version control system ?
    T Tridip Bhattacharjee

    just follow this link https://en.wikipedia.org/wiki/GitHub they are saying " It offers all of the distributed version control and source code management " what they try to mean distributed version control ? if we upload a project to github then many people around the world can work on the same project.......that is why GitHub is called distributed version control ? if yes then online TFS is also provide same functionality. if we upload a project to TFS then many people around the world can work on the same project but TFS never claim that it is distributed version control. so please some one who understand distributed version control then please explian why GitHub is consider distributed version control. thanks

    tbhattacharjee

    Hosting and Servers collaboration question announcement

  • What is merge join in sql server
    T Tridip Bhattacharjee

    searching google for merge join in sql server brings lots of result but i like to know when it is good or should i do it when joining one key is pk or other key is fk or regular key. in this kind of scenario merge join in sql server will be good. share your idea if you know. thanks

    tbhattacharjee

    Database question database sql-server sysadmin cryptography

  • What is merge join in sql server
    T Tridip Bhattacharjee

    what is merge and hash join ? if anyone know and use it then please share the knowledge. when one should go for merge and hash join. if possible discuss it with a good example the significance of merge and hash join. also tell me how merge and hash join is different from normal join thanks

    tbhattacharjee

    Database question database sql-server sysadmin cryptography
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups