Ten Years of Innovation and Firsts: Part I

Takeshi EtoIt’s hard to believe that DiscountASP.NET has been around for over a decade. From the start we’ve been laser focused on meeting the hosting needs of Microsoft developers and I think you would agree that we haven’t strayed from our original mission.

Every year I look back at the end of the year and talk about the top ten things we accomplished during the year – 2012 for example.  In this series, I’m going to look back on our ten years in business and talk about innovations and firsts that we introduced into the hosting world.

In Part I, I look back specifically on our business launch.

10years

1. ASP.NET Hosting

This is not a technical innovation but more about a new business focus. I published a prior blog post on the napkin drawing that was our “aha-moment” for our business plan. When we entered the hosting market back in 2003 there were many bigger hosting companies that offered Windows hosting as part of their portfolio and there were several Windows-only hosting providers. But we saw no one that focused on Microsoft .NET, a new framework that was introduced the year before. So we were the first host to go all-in for .NET and we led with “ASP.NET Hosting” as our core message. In doing so we showed that there were hosting niches that were still unaddressed.

2. .NET-Powered Control Panel

If we were going to claim the space of ASP.NET Hosting, we thought it would be important to have a .NET-powered control panel. The other control panels out there at the time were PHP or ASP powered canned solutions. And those hosts with proprietary control panels used legacy technologies. So we built our own shared hosting control panel using .NET – the first one in the industry as far as I know. In a previous Art of Hosting blog post I talked about some of the decisions a host needs to make regarding their control panel.

3. Windows 2003 Hosting

We launched our hosting business in 2003 and this was not by accident. We specifically targeted Windows 2003 as our entry point platform. There were no off-the-shelf hosting automation systems for Windows 2003, so we built our own. When Microsoft officially launched Windows 2003 – we launched that same week and we were the first shared host to offer Windows 2003 hosting.

So how did we build an entire hosting automation system for an OS that was not in the market yet? We were able to accomplish what we did because at that time Microsoft transitioned to a more open development stance and made betas available for Windows 2003 to the public.

4. Isolated Application Pool

With Internet Information Server (IIS) 6.0 on Windows 2003, Microsoft introduced isolated application pools. We thought this was cool and could help improve the reliability of shared Windows hosting. So we built our hosting platform to take advantage of this new feature and we hosted every site in its own isolated application pool.

However, by hosting every site in its own isolated application pools, there was real business impact. We could not host as many sites on the server as compared to hosting sites all within a shared application pool. We decided to focus on providing a more reliable hosting platform rather than focus on cramming more sites onto the web servers.

5. Full Trust

A benefit of hosting sites in isolated application pools is the ability to support full trust mode. If a host uses shared application pools in a shared hosting environment, they have to run in medium trust mode or else there will be serious security issues. Because users could bin deploy controls and run apps (e.g. CMS apps) that require full trust at DiscountASP.NET, we offered a more flexible hosting platform for developers.

In the next installment, I’ll talk about some of the tools we’ve launched in the control panel.

Our First Google+ Hangout is Coming

Michael OssouWe are holding our first Google+ Hangout on Thursday, July 18th at 2:30 Pacific time (technically this is our second hangout, though the first one was rather anticlimactic and sort of fail-y, so I can understand why Mr. Ossou chooses to pretend that it never happened – Editor).

Come watch us make fools of ourselves as we discuss all things ASP.NET and Web Dev.

Admission is free, valet parking will be provided, and you are all on the list.

How many apps have DiscountASP.NET users developed?

Stefanus HadiAs we enter a new fiscal year, Microsoft announced that the Windows Store surpassed 100,000 apps. This announcement came on the heels of the Microsoft //BUILD conference in San Francisco and about eight months after the official launch of the Windows 8 operating system.

While competitors including Google Play and Apple App Store are closer to 1 million apps, the latest Microsoft app growth trend is a generally positive one for Microsoft developers.

In our March 2013 survey, we asked our customers if they had experience building mobile applications and we observed that 47% of our U.S.-based customers have experience building mobile applications.

In a subsequent question, we asked how many web and mobile apps have they developed. For this post, I will only look at the 47% of U.S.-based customers with mobile application development experience and see how many apps they have developed.

The chart below shows that 19% of this group developed only one app. But most (49%) of this group developed between 2 to 10 apps and 32% of the group developed over 10 apps.

How many apps have our customers developed

So to recap, we are seeing a large percentage of our customers have experience developing mobile apps and those that make mobile apps are developing multiple apps. That’s great! That is exactly why we chose to develop and launch Snapp, our .NET Platform as a Service.

Curious about Snapp? You can sign up for our free beta.

Microsoft SQL Server Tips Series: Orphaned Users

Ray HuangThere is a problem you might encounter when restoring a database which has database users attached to it.  They will lose their mapping to their respective server login, and this will prevent you from logging into the database.  In this short article, I’ll show you how the problem is created, and how you can fix it.

Creating the Problem

As usual, I’ll start by attaching a copy of the AdventureWorks database to my local SQL Server instance.  Next, I’ll create a server login mapped to a database user called dbtestuser.

LocalDbTestUser

Now, make a backup copy of this database, upload it to your hosting account, and perform a restore operation using the DiscountASP.NET Control Panel.  If you log into your DiscountASP.NET database using SQL Server Management Studio and expand both Security Folders, you’ll notice the database user was restored but not the server login.

DASPDatabaseNoLogin

Normally, this isn’t an issue since you can just delete the database user and re-create the server login and database user.  We even provide this Knowledge Base article to assist you; however, one customer had this dilemma where his database users had permissions already assigned to objects in his database, and he wanted to keep them.  Recreating the logins was not an option in this case.

We will go ahead and create a server login with same name as the database user (in this case, dbtestuser) through the DiscountASP.NET Control Panel.

DASPControlPanel

But when you right click on the server login dbtestuser, select Properties, and then User Mapping in SQL Server Management Studio, you’ll notice it’s not mapped to a database user.

DASPDatbaseLoginProperties

If you check the box and try to map it to the database user through the SQL Server Management Studio GUI, you will get an error.

Error

Unfortunately, the mapping cannot be restored using the GUI tools.

The Solution

The solution is very simple.  After you have created the server login through the DiscountASP.NET Control Panel, you can just open a New Query window and execute the system stored procedure sp_change_users_login or use the ALTER USER command to restore the mapping.  I’ve included sample syntax below:

sp_change_users_login N’Update_One’, N’dbtestuser’, N’dbtestuser’

 

ALTER USER dbtestuser
WITH DEFAULT_SCHEMA = dbo,
LOGIN = dbtestuser

Now, when you right click on the server login dbtestuser, select Properties, and then User Mapping, it will show that it’s mapped correctly, and you will be able to log into your database.

MappedCorrectly

IEDOTNET UG MVM

Calvin WongIEDOTNET UG MVM

What?

That is the Inland Empire .NET User Group’s Most Valuable Member.

Every year, the Inland Empire group throws an award event to honor their members who have done the most for the community. Members earn points throughout the year for giving presentations, writing blog posts, attending events, taking classes, etc. Three members are awarded a “boatload of swag”, but it’s basically a party to celebrate the contributions made by all members.

The 6th Annual MVM event is being held on July 9th and DiscountASP.NET is honored to be a sponsor again.

We hope every has a great time! Congratulations to the winners!

Microsoft SQL Server Tips Series: Automatic database quota warning emails

Ray HuangHere’s a message from one of our customers, and I thought it was a great idea:

“I have discovered the problem. The database was full. Can I suggest that in future you implement a warning mechanism when approaching maximum usage of things like Database, Bandwidth etc. This would be very useful, even if it was just an automatic email sent out. Thanks.”

We actually do already have a process in place to warn you if you exceed your monthly bandwidth, but we don’t have one in place for databases because it is difficult to automate the process on a grand scale.

It would mean we would have to scan every database and make sure the email addresses we have on file are current and active, and that’s not always the case.  It’s not a good use of computer resources or time, and not every customer needs it.  So I am going to provide you with a custom solution!

That’s the beauty of the DiscountASP.NET hosting platform.  We give you the tools you need to create your own solution.  You may not realize that if we were to automate some processes it could lead to less freedom (more restrictions) in the way you can build or manage your application.

It’s a difficult balancing act to implement solutions and features that are useful, effective, and efficient.  Anyway, this solution can be implemented individually with relatively a few lines of code.

First, you’ll need to launch SQL Server Management Studio and log into your DiscountASP.NET database to create a stored procedure.  Click on the New Query button and copy the following code into the window:

CREATE PROCEDURE [dbo].[IsDatabaseAlmostFull]
AS
BEGIN
  DECLARE @CurrentSizeMB int
  DECLARE @MaxSizeMB int
  DECLARE @PercentageFull int
  SET NOCOUNT ON
  SET @PercentageFull = 0.90 /* Change this value */
  SELECT @CurrentSizeMB = size*8/1024,
         @MaxSizeMB = max_size*8/1024
  FROM sys.database_files
  WHERE [file_id] = 1
  IF @CurrentSizeMB >= (@MaxSizeMB * @PercentageFull)
    RETURN 1 /* True */
  ELSE
    RETURN 0 /* False */
END

The only value you need to change is on line 08.  The @PercentageFull variable determines at what percent the database fills up that you will get notified.

In the above example, you will get an email notification when your database reaches 90% full.

Hit F5 to execute the T-SQL code.

spIsDatabaseAlmostFull

You can go ahead and close SQL Server Management Studio and launch Visual Studio.

Then go to File -> New -> Website…  I’m more of a C# programmer, so under Templates, I’ll select Visual C# and choose ASP.NET Empty Web Site.  You can also name the folder if you’d like next to Web location.

Click the OK button to continue.

EmptyWebSite

On the right hand side under the Solution Explorer window, right click the folder name and select Add -> Add New Item…  Select Visual C#, Web Form, give the file a name if you’d like with a .aspx extension and make sure the option Place code in separate file is checked.

Click on the Add button.

WebForm

Under the Solution Explorer window, expand the file name with a .aspx extension to reveal the code-behind file which should end with a .aspx.cs extension.

Double click it to open the file.

SolutionExplorer

Paste the following code in the code-behind file replacing only the connection string and mail settings (lines 14 – 30).  Select Build -> Build Solution to compile your code and save your settings.

using System;
using System.Data;
using System.Data.SqlClient;
using System.Net;
using System.Net.Mail;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
   protected void Page_Load(object sender, EventArgs e)
   {
      String connectionString = @"Data Source=tcp:sql2k###.discountasp.net;Initial Catalog=SQL******_######_databasename;User ID=SQL******_#######_databasename_user;Password=*******;";

#region Mail Settings
// Settings used to authenticate and construct email message
// Hostname of your SMTP server
String smtpHostname = @"smtp.YourHostedDomainName.com";
// Set to 25 or 587 depending upon your email provider's instruction
int portNumber = 25;
// From address and account used to provide SMTP authentication
String fromAddress = @"[email protected]";
// Password for email account used to provide SMTP authentication
String emailPassword = @"*******";
// Address of email account that will receive the notification
String toAddress = @"[email protected]";
// Name of your database used to construct subject and body of email
String dbName = @"SQL******_######_databasename";
#endregion

 SqlConnection dbConnection = new SqlConnection();
 dbConnection.ConnectionString = connectionString;
 dbConnection.Open();

 SqlCommand command = new SqlCommand();
 command.CommandText = @"dbo.IsDatabaseAlmostFull";
 command.CommandType = CommandType.StoredProcedure;
 command.Connection = dbConnection;

 SqlParameter returnValue = command.Parameters.Add("RetVal", SqlDbType.Int);
 returnValue.Direction = ParameterDirection.ReturnValue;

 command.ExecuteNonQuery();

 int isFull = (int)returnValue.Value;

 dbConnection.Close();

 if (isFull == 1)
 {
 MailMessage confirmationMail = new MailMessage();
 confirmationMail.From = new MailAddress(fromAddress);
 confirmationMail.To.Add(toAddress);
 confirmationMail.Subject = @"Warning regarding " + dbName;
 confirmationMail.Body = @"Warning.  Database " + dbName + @" is nearing max capacity.";

 SmtpClient smtp = new SmtpClient(smtpHostname, portNumber);
 NetworkCredential credentials = new NetworkCredential(fromAddress, emailPassword);
 smtp.Credentials = credentials;
 smtp.Send(confirmationMail);
 }
 }
}

Now upload your files to your hosting account using an FTP client like FileZilla.

UploadFiles

Then launch the Scheduled Task Manager in the DiscountASP.NET Control Panel and setup a scheduled task for every 15 minutes that will invoke the code.

ScheduledTask

That’s it.

You will now receive an email notification whenever your database reaches or exceeds the percentage value you set in the stored procedure.

For those of you who know what you’re doing and are lazy like me, you can download the code files here and just adjust the settings I’ve mentioned above using any text editor.  I’ve included the .aspx, .aspx.cs, and .sql file for your convenience.

Mobile app acquisition and spending trends

Stefanus HadiThe following analysis is based on DiscountASP.NET’s survey conducted in March 2013. To gain some insight into our customers’ mobile application download behavior, we’ll look into data from our USA-based customers. We had 840 responses from the U.S. which represents about a 6% response rate.

We split our USA-based respondents into two groups, one group who had experience building mobile applications and the other group that did not. We found that 47% of the U.S.-based customers had experience building mobile applications, while 53% did not.

For labeling purposes, we will use the term as “Mobile App Developers” to refer to the 47% of customers that had experience building mobile applications. We will use the term as “ASP.NET Web Developers” to refer to the 53% of customers that did not have experience in building mobile apps.

In the next section, we observe the differences between these two groups in their mobile application download behavior in terms of application acquisition and spending.

(1) Acquisition

Mobile-application-acquisition

Among all of our USA-based customers, 10% of mobile app developers claimed that they only downloaded free mobile applications, while a higher percentage (17%) of ASP.NET web developers only downloaded free mobile apps.

(2) Spending

In the survey, we asked our customers how much they spent on acquiring mobile applications and the results are displayed in the following two charts. 19% of mobile app developers indicated that they spent less than $10 on acquiring mobile applications, compared to 31% of ASP.NET web developers who spent less than $10.

Mobile-application-spending-10

In contrast to the chart above, 23% of mobile app developers spent over $50 to acquire mobile applications, while only 12% of ASP.NET web developers who spent over $50.

Mobile-application-spending-50

In conclusion, the study showed that mobile app developers spent more money to get apps than ASP.NET web developers, and ASP.NET web developers are more likely to go for free apps than mobile app developers.

Mobile app acquisition and spending trends

Stefanus HadiThe following analysis is based on DiscountASP.NET’s survey conducted in March 2013. To gain some insight into our customers’ mobile application download behavior, we’ll look into data from our USA-based customers. We had 840 responses from the U.S. which represents about a 6% response rate.

We split our USA-based respondents into two groups, one group who had experience building mobile applications and the other group that did not. We found that 47% of the U.S.-based customers had experience building mobile applications, while 53% did not.

For labeling purposes, we will use the term as “Mobile App Developers” to refer to the 47% of customers that had experience building mobile applications. We will use the term as “ASP.NET Web Developers” to refer to the 53% of customers that did not have experience in building mobile apps.

In the next section, we observe the differences between these two groups in their mobile application download behavior in terms of application acquisition and spending.

(1) Acquisition

Mobile-application-acquisition

Among all of our USA-based customers, 10% of mobile app developers claimed that they only downloaded free mobile applications, while a higher percentage (17%) of ASP.NET web developers only downloaded free mobile apps.

(2) Spending

In the survey, we asked our customers how much they spent on acquiring mobile applications and the results are displayed in the following two charts. 19% of mobile app developers indicated that they spent less than $10 on acquiring mobile applications, compared to 31% of ASP.NET web developers who spent less than $10.

Mobile-application-spending-10

In contrast to the chart above, 23% of mobile app developers spent over $50 to acquire mobile applications, while only 12% of ASP.NET web developers who spent over $50.

Mobile-application-spending-50

In conclusion, the study showed that mobile app developers spent more money to get apps than ASP.NET web developers, and ASP.NET web developers are more likely to go for free apps than mobile app developers.