DataAccessHelper.cs

Last post 11-01-2009 10:18 PM by chetan.sarode. 7 replies.

Sort Posts:

  • DataAccessHelper.cs

    10-27-2009, 2:58 AM
    • Member
      1 point Member
    • vinaytedla
    • Member since 07-09-2009, 11:18 AM
    • Bangalore, India
    • Posts 4

    Hi,

    Iam the beginner to the asp.net.

    I gone through the code of the TimeTracker.

    What is the use of DataAccessHelper.cs?

    What is the Difference between

    DataAccess dc = (DataAccess)Activator.CreateInstance(dataAccessType); and

    DataAccess dc=new DataAccess()

    Please explain me in detail..


    Thanks in advance..


    Thanks
    Vinay
  • Re: DataAccessHelper.cs

    10-27-2009, 3:38 AM
    Answer
    • Participant
      1,464 point Participant
    • DeadBurger
    • Member since 03-06-2006, 8:44 AM
    • Posts 225

    CreateInstance uses reflection and is much slower than using new DataAccess() the benefit with reflection is you can create a dynamic instance like a user configured type, mostly used in plug-in architectures. Another benefit with Activator.CreateInstance is that you can create an instance off non-public members too.

    Shortly:

    If you know the type when writing the code use new DataAccess(), if the type is defined runtime use reflection.

    If this answer helps you, mark it as an answer to make the community better.

    Blog: http://deadburger.blogspot.com/
  • Re: DataAccessHelper.cs

    10-27-2009, 3:47 AM
    • Contributor
      2,914 point Contributor
    • shabirhakim1
    • Member since 03-31-2009, 11:33 AM
    • Bangalore
    • Posts 476

    Hi Great Man,
    you can see Great Explaination of same with examples here
    http://blogs.msdn.com/haibo_luo/archive/2005/11/17/494009.aspx

    Regards

    Good is Never Good .if better is accepted
  • Re: DataAccessHelper.cs

    10-27-2009, 11:05 PM
    Chetan Sarode
    Software Engineer,
    Approva Systems Pvt Ltd,
    Pune, India.
  • Re: DataAccessHelper.cs

    10-28-2009, 10:54 PM

    Have you got the difference

    Chetan Sarode
    Software Engineer,
    Approva Systems Pvt Ltd,
    Pune, India.
  • Re: DataAccessHelper.cs

    10-29-2009, 12:47 AM
    • Member
      1 point Member
    • vinaytedla
    • Member since 07-09-2009, 11:18 AM
    • Bangalore, India
    • Posts 4

    Thanks, I got the difference.

    Thanks
    Vinay
  • Re: DataAccessHelper.cs

    10-29-2009, 10:58 PM

    Please mark the answer that helps you, it will help to track the status of thread 

    Chetan Sarode
    Software Engineer,
    Approva Systems Pvt Ltd,
    Pune, India.
  • Re: DataAccessHelper.cs

    11-01-2009, 10:18 PM

    Thanks 

    Chetan Sarode
    Software Engineer,
    Approva Systems Pvt Ltd,
    Pune, India.
Page 1 of 1 (8 items)