MWS.Data.DBWrapper.GetConnection C# (CSharp) Method

GetConnection() protected method

protected GetConnection ( ) : IDbConnection
return IDbConnection
		protected IDbConnection GetConnection()
		{
			IDbConnection oReturn = null;

			switch(this.PROVIDER)
			{
				case PROVIDER_TYPE.PROVIDER_SQLCLIENT:
					oReturn = new SqlConnection();
					break;

				case PROVIDER_TYPE.PROVIDER_OLEDB:
					oReturn = new OleDbConnection();
					break;

				case PROVIDER_TYPE.PROVIDER_ODBC:
					oReturn	= new OdbcConnection();
					break;

				/*case PROVIDER_TYPE.PROVIDER_ORACLE:
					oReturn	= new OracleConnection();
					break;*/

				case PROVIDER_TYPE.PROVIDER_OTHER:
					oReturn = (IDbConnection) GetADONETProviderObject(ProviderAssemblyName, ProviderCommandBuilderClassName, null);
					break;

				default:
					throw(new Exception("Invalid provider type"));
			}

			if(oReturn == null)
				throw(new Exception("Failed to get ADONET Connection object [IDbConnection]"));

			return oReturn; 
			
		}