|
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using AndrewGolik.DaoTraining.DataAccessLayer;
using System.Data.SqlClient;
namespace AndrewGolik.DaoTraining.DataAccessLayer.MSSql
{
public class MSSqlDaoFactory:DaoFactory
{
public static string ConnectionString
{
get
{
if (ConfigurationManager.ConnectionStrings["MsSqlDao"] == null)
throw new NullReferenceException("MsSqlDao connectionString configuration is missing from your web.config.");
string connectionString = ConfigurationManager.ConnectionStrings["MsSqlDao"].ConnectionString;
if (String.IsNullOrEmpty(connectionString))
throw new NullReferenceException("MsSqlDao connectionString configuration is missing from your web.config.");
else
return connectionString;
}
}
public override CustomerDao GetCustomerDao()
{
return new MSSqlCustomerDao();
}
public override OrderDao GetOrderDao()
{
return new MSSqlOrderDao();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
Andrew Golik is a software professional working in Minsk, Belarus.
He enjoys design infrastructures based on object oriented paradigm. His programming experience includes ASP, ASP.NET, .NET, COM, JAVA, PHP, DHTML, AJAX, blah blah blah....
Andrew Golik's Blog