Archives

Archives / 2005 / August
  • ASP.NET DataProvider Singleton Vs. Static Vs. Instantiate When Needed

    I have seen all versions used a hundred times.  Which is the best way in a closed shop ASP.NET application using strictly SQL Server for data storage?
     
    Do you instantiate a singleton copy of the dataprovider for the entire application to use?  Or just a bunch of static methods (yuch)? Or do you instantiate the dataprovider every time needed?  Are there threading issues involved  here?  What about transactions?