Tag Archives: cheap and affordable asp.net hosting

ByAlexia Pamelov

Cheap Windows Reseller ASP.NET Hosting Comparison 2016

CheapWindowsHosting.com | Cheap windows reseller ASP.NET hosting comparison 2016. When you’re ready to take your data into your own hands and run your own blog, own your own photos, and host your own apps, it’s time to find a good web host that can put it all on the web for you, give you the tools, bandwidth, and storage you need, and support you when you need help. Thankfully, there are dozens of great companies looking for your business, and this week we’re going to look at three of the best, based on your nominations.

Are you looking for the best windows reseller ASP.NET Hosting?

Your Best Hosting search is over!

Do not Lose Money and Time and find the best Windows Hosting for you in our Cheap ASP.NET Web Hosting Providers recommended list!

Cheap Windows Reseller ASP.NET Hosting 2016

ASPHostPortal Best Windows Reseller .NET Hosting

Why we choose ASPHostPortal for the best reseller windows hosting?

ASPHostPortal.com, a Microsoft Golden hosting partner has been offering well priced Windows and ASP.NET hosting plans for many years. Founded in 2008 and operated in New York, US. ASPHostPortal.com has become an important resource for cutting-edge, high-value hosting solutions. The company also offers low priced enterprise-level hosting plans by focusing their resources on needs by ASP.NET Windows’s developers.

This company supports almost all the latest ASP.NET technology and provides plenty of server resources for every hosting account. Below are the list of key features, but definitely it provides more:

ASPHostPortal.com Feature

  • Unlimited Website
  • Latest MS SQL Server 2012 R2
  • ASP.NET 4.5.1/4.5/3.5/2.0
  • IIS 8.5 with Full trust allowed
  • Private Name Server
  • Whitelabel solution
  • SmarterMail email System
  • Web-based Plesk Panel hosting
  • Unlimited FTP, Sub domains, mail boxes
  • PHP, MySQL 5 Database

They also offer unlimited Email accounts with their Reseller Web hosting plans with combination of Free Domain, Private/Anonymous Name Servers, 24/7 friendly Customer Support, 30 Day Money Back Guarantee and more!

myhosting VPS Reseller .NET Hosting

myhosting VPS Reseller hosting plans provide white label, simple and cost effective solutions to your ever expanding ASP.NET Web hosting needs. Not only can you become a ASP.NET hosting reseller overnight, but you have the tools to expand as needed. And, avoid the burden of novice clients requiring help with the intuitive client side control panel!

myHosting Feature

  • VPS Reseller ASP.NET Web Hosting
  • ASP.NET 4.5/4.0/3.5, ASP, AJAX
  • Unlimited Domains
  • Private Nameservers
  • Client & Admin Control Panels
  • 24/7 In-house Enterprise Support
  • Whitelabel Solution

ONLY NOW 25% off for all VPS Windows Reseller Hosting plans! Business or Developer. Monthly or Annual.

Coupon Code: 25OFFWIN2012

Get your Reseller hosting and SAVE money now!

LiquidWeb Dedicated Reseller Hosting

Liquid Web is a leading provider of premium Dedicated Reseller Windows Hosting products and data center infrastructure.

Established in 1997, Liquid Web’s growth has been fueled by providing unbeatable managed Windows hosting services to businesses of all sizes, in all areas of the world.

Unlike most Reseller Web hosting providers, Liquid Web owns & operates its entire infrastructure. All of the Liquid Web datacenters are staffed 24/7 on-site by their Heroic Support® engineers. This allows they to provide an unmatched level of security and reliability by responding to issues directly.

At Liquid Web, 24/7 Heroic Support® services are available with all dedicated Windows Reseller hosting server plans. Their Heroic Support® services include 24 hour pro-active server level monitoring, pro-active service restoration and the peace of mind of a 100% network uptime guarantee.

LiquidWeb Feature

  • Dedicated Reseller ASP.NET Web Hosting
  • Managed Windows Hosting
  • ASP.NET 4.5/4.0/3.5, ASP, AJAX
  • Windows 2012 Servers Available
  • 24/7 Heroic Support®
  • 30 Minute Hardware Replacement SLA
  • 100% network uptime guarantee

Find the best Reseller ASP.NET Web Hosting provider

Why do you look for a new commercial Reseller Windows Hosting Provider? Because you have created your new ASP.NET website, because you are not happy with your recent ASP.NET hosting company, because you would like to upgrade (need more resources) your recent Windows hosting services, or because you want to start a small ASP.NET hosting business.

findIn all of the above reasons what will be the best Reseller hosting for you? The best Reseller Host will give you the opportunity to focus on your main business, to provide better services for your web site visitors/customers, to have a better company Image, because fast and reliable Reseller hosting means stable and serious website, and it could also create an advantage over your competitors. Otherwise, if you choose poor Windows Reseller Host it could be catastrophic for your business and you could also lose time and money to move your website to a new Reseller Web Host and pay for new hosting services.

There are many ASP.NET hosting companies that offer different types of ASP.NET Web hosting services and technologies, but essential for the Customer is the value of these ASP.NET Hosting services, which means that the ASP.NET Host should best suit all of his requirements!

Every Windows Hosting company has advantages and dis- advantages. Some ASP.NET Hosting companies offer better Shared or Reseller Hosting, others have excellent Windows Web Hosting support or better prices. So remember that if some ASP.NET Hosting provider is the best for your requirements, it could be not for somebody else!

ByAlexia Pamelov

Cheap Windows Hosting – Entity Framework and handling Exceptions

CheapWindowsHosting.com | Cheap and affordable windows hosting. In this tutorial we will learn about Logging database operations in Entity Framework and handling Exceptions.

Entity Framework (EF) is an object-relational mapper that enables .NET developers to work with relational data using domain-specific objects. It eliminates the need for most of the data-access code that developers usually need to write.

If you are using the EF6 and want to log the database operations, analyze them, then, this is the right place for you.

When I was developing one WebApi project, what I was searching for is an output each query performed by Entity framework should be logged with time. Also, exception if there is any. So, in this section, you will learn how to log commands and queries to the database generated by Entity framework.

There are two ways using code

  • Simple Method
using (MyDatabaseEntities context = new MyDatabaseEntities())
     {
         context.Database.Log = s => System.Diagnostics.Debug.WriteLine(s);
          // query the database using EF here.
      }

This will log the database operations in the output window. What it does is it writes the operations performed byEntityFramework to the output window. It gives awesome traces.

Have a look :

1

  • IDbCommandInterceptor

This uses the IDbCommandInterceptor Interface. This is in-built in Entity framework 6.

Note: This is available in Entityframework 6 and later.

Interface looks like this:

namespace System.Data.Entity.Infrastructure.Interception
{
  /// <summary>
  /// An object that implements this interface can be registered with 
  /// <see cref="T:System.Data.Entity.Infrastructure.Interception.DbInterception"/> to
  ///             receive notifications when Entity Framework executes commands.
  /// 
  /// </summary>
  /// 
  /// <remarks>
  /// Interceptors can also be registered in the config file of the application.
  ///             See http://go.microsoft.com/fwlink/?LinkId=260883 
  ///             for more information about Entity Framework configuration.
  /// 
  /// </remarks>
  public interface IDbCommandInterceptor : IDbInterceptor
  {
    /// <summary>
    /// This method is called before a call to 
    /// <see cref="M:System.Data.Common.DbCommand.ExecuteNonQuery"/> or
    ///             one of its async counterparts is made.
    /// 
    /// </summary>
    /// <param name="command">The command being executed.</param>
    /// <param name="interceptionContext">
    /// Contextual information associated with the call.</param>
    void NonQueryExecuting(DbCommand command, DbCommandInterceptionContext<int> interceptionContext);

    /// <summary>
    /// This method is called after a call to 
    /// <see cref="M:System.Data.Common.DbCommand.ExecuteNonQuery"/>  or
    /// one of its async counterparts is made. 
    /// The result used by Entity Framework can be changed by setting
    /// <see cref=
    /// "P:System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext`1.Result"/>.
    /// 
    /// </summary>
    /// 
    /// <remarks>
    /// For async operations this method is not called until after the async task has completed
    ///             or failed.
    /// 
    /// </remarks>
    /// <param name="command">The command being executed.</param>
    /// <param name=
    /// "interceptionContext">Contextual information associated with the call.</param>
    void NonQueryExecuted(DbCommand command, DbCommandInterceptionContext<int> interceptionContext);

    /// <summary>
    /// This method is called before a call to 
    /// <see cref="M:System.Data.Common.DbCommand.ExecuteReader(System.Data.CommandBehavior)"/> or
    /// one of its async counterparts is made.
    /// 
    /// </summary>
    /// <param name="command">The command being executed.</param>
    /// <param name="interceptionContext">Contextual information associated with the call.
    /// </param>
    void ReaderExecuting(DbCommand command, 
  DbCommandInterceptionContext<DbDataReader> interceptionContext);

    /// <summary>
    /// This method is called after a call to 
    /// <see cref="M:System.Data.Common.DbCommand.ExecuteReader(System.Data.CommandBehavior)"/> or
    /// one of its async counterparts is made. 
    /// The result used by Entity Framework can be changed by setting
    /// <see cref=
    /// "P:System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext`1.Result"/>.
    /// 
    /// </summary>
    /// 
    /// <remarks>
    /// For async operations this method is not called until after the async task has completed
    ///             or failed.
    /// 
    /// </remarks>
    /// <param name="command">The command being executed.</param>
    /// <param name="interceptionContext">
    /// Contextual information associated with the call.</param>
    void ReaderExecuted(DbCommand command, 
    	DbCommandInterceptionContext<DbDataReader> interceptionContext);

    /// <summary>
    /// This method is called before a call to 
    /// <see cref="M:System.Data.Common.DbCommand.ExecuteScalar"/> or
    ///             one of its async counterparts is made.
    /// 
    /// </summary>
    /// <param name="command">The command being executed.</param>
    /// <param name="interceptionContext">
    /// Contextual information associated with the call.</param>
    void ScalarExecuting(DbCommand command, DbCommandInterceptionContext<object> interceptionContext);

    /// <summary>
    /// This method is called after a call to 
    /// <see cref="M:System.Data.Common.DbCommand.ExecuteScalar"/> or
    /// one of its async counterparts is made. 
    /// The result used by Entity Framework can be changed by setting
    /// <see cref=
    /// "P:System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext`1.Result"/>.
    /// 
    /// </summary>
    /// 
    /// <remarks>
    /// For async operations this method is not called until after the async task has completed
    ///             or failed.
    /// 
    /// </remarks>
    /// <param name="command">The command being executed.
    /// </param><param name="interceptionContext">
    /// Contextual information associated with the call.</param>
    void ScalarExecuted(DbCommand command, DbCommandInterceptionContext<object> interceptionContext);
  }
}

Let’s derive this interface to the DatabaseLogger class.

FYI, I have added my log information into database. You may insert into file, Excel, anything you want.

You need not worry about the methods Interface itself is very self explanatory. It has 6 methods, which you can see I have derived and check comments to understand each scenario.

//this file is used to log the database operations it checks
//the query execution time and than insert if it takes more than one second.
 //to disable it remove its registry from TeamPassDbContext default constructor
 public class DatabaseLogger : IDbCommandInterceptor
 {
     static readonly ConcurrentDictionary<DbCommand,
     DateTime> MStartTime = new ConcurrentDictionary<DbCommand, DateTime>();

     public void NonQueryExecuted(DbCommand command,
     DbCommandInterceptionContext<int> interceptionContext)
     {
         //executed state
         Log(command, interceptionContext);
     }

     public void NonQueryExecuting(DbCommand command,
     DbCommandInterceptionContext<int> interceptionContext)
     {
         //executing state
         OnStart(command);
     }

     public void ReaderExecuted(DbCommand command,
     DbCommandInterceptionContext<DbDataReader> interceptionContext)
     {
         //reader executed state
         Log(command,interceptionContext);
     }

     public void ReaderExecuting(DbCommand command,
     DbCommandInterceptionContext<DbDataReader> interceptionContext)
     {
         //reader executing state
         OnStart(command);
     }

     private static void Log<T>(DbCommand command,
     DbCommandInterceptionContext<T> interceptionContext)
     {
         DateTime startTime;
         TimeSpan duration;
         //Removing from dictionary and calculating time
         MStartTime.TryRemove(command, out startTime);
         if (startTime != default(DateTime))
         {
             duration = DateTime.Now - startTime;
         }
         else
             duration = TimeSpan.Zero;

         const int requestId = -1;

         var parameters = new StringBuilder();
         foreach (DbParameter param in command.Parameters)
         {
             parameters.AppendLine(param.ParameterName + " " +
             param.DbType + " = " + param.Value);
         }

         var message = interceptionContext.Exception == null ?
         $"Database call took {duration.TotalSeconds.ToString("N3")} sec.
         RequestId {requestId} \r\nCommand:\r\n{parameters + command.CommandText}" :
         $"EF Database call failed after {duration.TotalSeconds.ToString("N3")} sec.
         RequestId {requestId} \r\nCommand:\r\n{parameters.ToString() +
         command.CommandText}\r\nError:{interceptionContext.Exception} ";

         //Ignoring some queries which runs perfectly
         if (duration.TotalSeconds>1 || message.Contains("EF Database call failed after "))
         {
             //The time taken is more or it contains error so adding that to database
             using (DbContext dbContext = new DbContext())
             {
                 //using error model class
                 Error error = new Error
                 {
                     TotalSeconds = (decimal)duration.TotalSeconds,
                     Active = true,
                     CommandType = Convert.ToString(command.CommandType),
                     CreateDate = DateTime.Now,
                     Exception = Convert.ToString(interceptionContext.Exception),
                     FileName = "",
                     InnerException = interceptionContext.Exception == null ?
                     "" : Convert.ToString(interceptionContext.Exception.InnerException),
                     Parameters = parameters.ToString(),
                     Query = command.CommandText,
                     RequestId = 0
                 };
                 //Adding to database
                 dbContext.Errors.Add(error);
                 dbContext.SaveChanges();
             }

             //var errorFileUrl = ;
             //File.WriteAllLines(, message);
         }
     }

     public void ScalarExecuted
     (DbCommand command, DbCommandInterceptionContext<object> interceptionContext)
     {
         //Log and calculate after executed
         Log(command, interceptionContext);
     }

     public void ScalarExecuting
     (DbCommand command, DbCommandInterceptionContext<object> interceptionContext)
     {
         //adding to dictionary when executing
         OnStart(command);
     }
     private static void OnStart(DbCommand command)
     {
         //adding to dictionary when executing
         MStartTime.TryAdd(command, DateTime.Now);
     }
 }

Now, I am registering this class to dbcontext. What it does is, It tells entity framework to use this class for logging database operations.

public DbContext(): base("name=connectionstring")
       {
           //TODO remove this when don't need to log anything
           DbInterception.Add(new DatabaseLogger());
       }

Everything is set up now. You can make an Error model class like this. (This is the code-first model class.)

public class Error
  {
      [Key]
      [Required]
      public int ErrorId { get; set; }
      public string Query { get; set; }
      public string Parameters { get; set; }
      public string CommandType { get; set; }
      public decimal TotalSeconds { get; set; }
      public string Exception { get; set; }
      public string InnerException { get; set; }
      public int RequestId { get; set; }
      public string FileName { get; set; }
      public DateTime CreateDate { get; set; }
      public bool Active { get; set; }
  }

You can see the error logs here

2

Technically, there are many approaches to log your database operations. But, I think this should be centralized to reduce the load. That is why I used this approach.