Windows 2012 Hosting - MVC 6 and SQL 2014 BLOG

Tutorial and Articles about Windows Hosting, SQL Hosting, MVC Hosting, and Silverlight Hosting

SQL 2012 Hosting - ASPHostPortal :: How to Manage SQL 2012 with Powershell

clock September 11, 2012 09:20 by author Jervis

     The graphical management tools provide just in this area everything you need to work with SQL Server. Still, there are many times when you might want to work from the command line, such as when you are working on a Windows Server 2008 R2 Core installation. To help with all your command-line needs, SQL Server 2012 includes the SQL Server provider for Windows PowerShell (also known as “SQL Server PowerShell”). To work with SQL Server via Windows PowerShell, you must first open a Command Prompt window or Windows PowerShell prompt and then initiation SQL Server PowerShell by typing sqlps at the command line.

Windows PowerShell introduces the concept of a cmdlet (pronounced “commandlet”). A cmdlet is the smallest unit of functionality in Windows PowerShell. Cmdlet names are not case-sensitive. SQL Server PowerShell cmdlets include the following:


-
Backup-SQLDatabase Performs backup operations on SQL Server databases.

-
Convert-UrnToPath Converts a SQL Server Management Object Uniform Resource Name (URN) to a SQL Server provider path. The URN indicates
a management object’s place within the SQL Server object hierarchy. If the URN path has characters not supported by Windows PowerShell, the characters are encoded automatically.

-
Decode-SQLName Returns an unencoded SQL Server identifier when given an identifier that has been encoded.

-
Encode-SQLName Encodes special characters in SQL Server identifiers and name paths to formats that are usable in Windows PowerShell paths. The characters encoded by this cmdlet include :/%<>*?[]|. If you don’t encode these characters, you must getting away from them by using the single quotation mark (‘) character.

-
Invoke-PolicyEvaluation Evaluates management policies applied to SQL Server instances. By default, this cmdlet intelligence compliance but does not enforce compliance. To enforce compliance, set –AdHocPolicyEvaluationMode to Configure.

-
Invoke-Sqlcmd Runs a Transact-SQL (T-SQL) or XQuery script containing orders supported by the SQLCMD utility. By default, this cmdlet doesn’t set any SQLCMD variables or return message output; only a subset of SQLCMD orders can be used.

-
Restore-SQLDatabase Performs restore operations on SQL Server databases.

To get detailed information in this area a cmdlet, type get-help cmdletname –detailed, where cmdletname is the name of the cmdlet you want to examine. To get detailed information in this area the SQL Server provider, which provides SQL Server functionality for Windows PowerShell, type
get-help sqlserver | more.

You can use the sqlps utility on any computer where you’ve installed SQL Server or the command-line management tools. The sqlps utility starts a Windows PowerShell session with the SQL Server PowerShell provider imported so that you can use its cmdlets and work with instances of SQL Server. When you are working with Windows PowerShell or scripts, you can import the SQLPS module to load the SQL Server provider, which automatically loads the vital assemblies and initializes the environment. While you previously needed to use an initialization script, this is no longer vital so long as you import the SQLPS module prior to trying to access the SQL Server instance. For best results, import the SQLPS module using the following command:


   Import-Module "sqlps" –DisableNameChecking

You can work with cmdlets by executing orders directly at the shell prompt or by running orders from scripts. You can enter any command or cmdlet that you can run at the Windows PowerShell command prompt into a script by copying the related command text to a file and reduction the file with the .ps1 extension. You can then run the script in the same way that you would any other command or cmdlet. Even if, when you are working with Windows PowerShell, the current index might not be part of the environment path. For this reason, you might need to use the ./ notation when you run a script in the current index, such as the following:

./runtasks


The current execution policy for SQL Server PowerShell controls whether and how you can run scripts. Although the default configuration depends on which operating system and journal you’ve installed, you can quickly determine the execution policy by inflowing get-executionpolicy at the Windows PowerShell prompt.


To set the execution policy to require that all scripts have a trusted signature to do, enter the following command:


set-executionpolicy allsigned

To set the execution policy so that scripts downloaded from the web do only if they are signed by a trusted source, enter:


set-executionpolicy remotesigned

To set the execution policy to run scripts regardless of whether they have a digital signature and work in an unrestricted environment, you can enter the following command:


set-executionpolicy unrestricted

For administration at the Windows PowerShell prompt, you use Invoke-Sqlcmd to run T-SQL or XQuery scripts containing orders supported by the SQLCMD utility. Invoke-Sqlcmd fully supports T-SQL and the XQuery syntax supported by the Database Engine, but it does not set any scripting variables by default. Invoke-Sqlcmd also accepts the SQLCMD orders listed in Table 1-3, later in this chapter. By default, results are formatted as a table, with the first result set showed automatically and subsequent result sets showed only if they have the same column list as the first result set.


The basic syntax you use most often with Invoke-Sqlcmd follows:


Invoke-Sqlcmd [-ServerInstance ServerStringOrObject]

[-Database DatabaseName] [-EncryptConnection ]
[-Username UserName] [-Password Password] [[-Query] QueryString] [-DedicatedAdministratorConnection]

[-InputFile FilePath] [ | Out-File –filepath FilePath]


The command’s parameters are used as follows:


–Database Specifies the name of the database that you want to work with. If you don’t use this parameter, the database that is used depends

on whether the current path specifies both the SQLSERVER:SQL folder
and a database name. If both are specified, Invoke-Sqlcmd connects to the database that is specified in the path. Otherwise, Invoke-Sqlcmd connects to the default database for the current login ID.

NOTE
Use–IgnoreProviderContext to force a connection to the database that is defined as the default for the current login ID.

–DedicatedAdministratorConnection Ensures that a dedicated administrator connection (DAC) is used to force a connection when one might not be possible otherwise.

–EncryptConnection Enables Secure Sockets Layer (SSL) encryption for the connection.


–InputFile Provides the full path to a file that must be used as the query participation. The file can contain T-SQL statements, XQuery statements, SQLCMD orders, and scripting variables. Spaces are not allowable in the file path or file name.


–Password Sets the password for the SQL Server Certification login ID that is specified in –Username.


–Query Defines one or more queries to be run. The queries can be T-SQL queries, XQuery statements, or SQLCMD orders. Separate multiple queries with semicolons.


TIP You do not need to use the SQLCMD GO command. Getting away from any dual quotation marks included in the string and consider using bracketed identifiers such as [EmpTable] instead of quoted identifiers such as “EmpTable”. To ensure that the message output is returned, add the –Verbose parameter. –Verbose is a parameter common to all cmdlets.


–ServerInstance Specifies the name of an instance of the Database Engine that you want to work with. For default instances, specify only the computer name, such as DbServer23. For named instances, use the format “ComputerNameInstanceName”, such as DbServer23EmployeeDb.


–Username Sets the login ID for making a SQL Server certification connection to an instance of the Database Engine. You also must set the password for the login ID.


NOTE By default, Invoke-Sqlcmd attempts a Windows certification connection

by using the Windows tab running the Windows PowerShell session. Windows certification connections are preferred. To use a SQL Server certification connection instead, specify the user name and password for the SQL login ID that you want to use.

With this in mind, you could replace the following T-SQL statements:


USE OrderSystem;
GO
SELECT * FROM Inventory.Product
ORDER BY Name ASC
GO


with the following Windows PowerShell command:


Invoke-Sqlcmd -Query "SELECT * FROM Inventory.Product; ORDER BY Name ASC"
-ServerInstance "DbServer23OrderSystem"


You also could read the orders from a script, as publicized in Try out 1-1. SAMPLE 1-1 Example SQL Command Script.


Contents of SqlCmd.sql Script.

 SELECT * FROM Inventory.Product
 ORDER BY Name ASC


Command to Run the Script

 Invoke-Sqlcmd -InputFile "C:ScriptsSqlCmd.sql"

22 PART I Microsoft SQL Server 2012 Essentials

When you work with Windows PowerShell, don’t overlook the importance of SQL Server help being implemented owing to a provider. The data that providers expose appears as a drive that you can browse. One way to browse is to get or set the place with respect to the SqlServer: provider drive. The top of the hierarchy exposed is represented by the SQL folder, then there is a folder for the machine name, and finally, there is a folder for the instance name. Following this, you could navigate to the top-level folder for the default instance by inflowing

Set-Place SQLSERVER:SQLDbServer23Default

You could then determine the available database structures by inflowing Get-ChildItem (or one of its aliases, such as ls or dir). To navigate logins, triggers, endpoints, databases, and any other structures, you set the place to the name of the related folder. For example, you could use Set-Place Databases and then enter Get-ChildItem to list available databases for the selected instance. Of course, if you know the full path you want to work with in the first place, you also can access it directly, as publicized in the following example:


Set-Place SQLSERVER:SQLDbServer23DefaultDatabasesOrderSystem

Here, you navigate to the structures for the OrderSystem database on DbServer23’s default instance. If you then want to determine what tables are available for this database, you could enter:


Get-ChildItem Tables

Or you could enter:


Set-place Tables
Get-ChildItem


To manage SQL Server 2012 from a computer that isn’t running SQL Server, you need to install the management tools. In the SQL Server Installation Center, select Installation, and then click the New Installation Or Add Features To An Existing Installation choice. When the wizard starts, follow the prompts. On the Feature Choice page, select the Management Tools—Basic choice to install Management Studio, SQLCMD, and the SQL Server provider for Windows PowerShell.


For diffident management via Windows PowerShell, you need to ensure that Windows Diffident Management (WinRM) and Windows PowerShell are both installed and made available by using the Add Features Wizard. You also need to make possible diffident orders on both your management computer and the server running SQL Server.

You can verify the availability of WinRM and configure Windows PowerShell for remoting by following these steps:

1. Click Initiation, All Programs, Accessories, and Windows PowerShell. Then initiation Windows PowerShell as an administrator by right-clicking the Windows PowerShell shortcut and selecting Run As Administrator.

2. The WinRM service is configured for manual startup by default. You
must change the startup type to Automatic and initiation the service on each computer you want to work with. At the PowerShell prompt, you can verify that the WinRM service is running by using the following command:

      get-service winrm


        0. f the service is stopped, enter the following command to initiation the service and configure it to initiation automatically in the future:

            set-service –name winrm –startuptype automatic –status running

        1. To configure Windows PowerShell for remoting, type the following command:

            Make possible-PSRemoting –force

You can make possible remoting only when your computer is connected to a domain or private network. If your computer is connected to a public network, you need to disconnect from the public network and connect to a domain or private network and then repeat this step. If one or more of your computer’s connections has the Public connection type but you are really connected to a domain or private network, you need to change the network connection type in the Network And Sharing Center and then repeat this step.

In many cases, you can work with diffident computers in other domains. Even if, if the diffident computer is not in a trusted domain, the diffident computer might not be able to authenticate your credentials. To make possible certification, you need to add the diffident computer to the list of trusted hosts for the local computer in WinRM. To do so, type the following:

winrm s winrm/config/client ‘@{TrustedHosts=”RemoteComputer”}’ where RemoteComputer is the name of the diffident computer, such as winrm s winrm/config/client ‘@{TrustedHosts=”DbServer23″}’


When you are working with computers in workgroups or homegroups, you must use HTTPS as the transport or add the diffident machine to the TrustedHosts configuration settings. If you cannot connect to a diffident host, you can verify that the service on the diffident host is running and is accepting requests by running the following command on the diffident host:


winrm quickconfig
Status   Name
------   ----
Running  WinRM
DisplayName
-----------
Windows Diffident Management


24 PART I Microsoft SQL Server 2012 Essentials


This command analyzes and configures the WinRM service. If the WinRM service is set up correctly, you see output similar to the following:


WinRM already is set up to receive requests on this machine.
WinRM already is set up for diffident management on this machine.

If the WinRM service is not set up correctly, you see errors and need to respond affirmatively to several prompts that allow you to configure diffident management automatically. When this process is complete, WinRM must be set up correctly. Don’t forget that you need to make possible diffident management on the database server as well as your management computer.


Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what
ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.

- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.

- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.

- Data Center

ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.

- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.

- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.

- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.

 



SQL 2012 Hosting - ASPHostPortal :: Integration Services Catalog in SQL Server 2012

clock September 8, 2012 06:07 by author Jervis

Integration Services Catalog is a new feature in SQL Server 2012 which supports the centralization of storage of packages and configuration files. You can host only one catalog for one SQL Server Instance. When you deploy your project using project deployment model all project components stored in catalog. This post describes how to create a catalog and set the properties.



Catalog creation

1. In SQL Server Management Studio , right click the Integration Services Catalogs folder and Select Create Catalog.


2. In Create Catalog dialog box, Select Enable Automatic execution of Integration Services Stored Procedure.

3. Catalog database name can not be changed and it is set to default name SSISDB. Provide the password and click ok as shown below.



Integration services uses this password to encrypt sensitive data stored in catalog.


Catalog Properties

To set the properties , right click SSISDB and select properties and you will get the properties dialogue box as shown below



The default encryption algorithm is AES_256. Operations include activities such as project deployment, project validation and project execution. Integration Services stores this information in catalog. You can see the active operations in catalog by right clicking SSISDB database.

Project Versioning

Each time you re-deploy a project with the same name to same folder 10 versions are maintained in list.

-
Locate the project under SSISDB database, right click on it and select versions.
-
In the project versions dialogue box, select the version to restore and click restore button



click yes to confirm, and then click OK to close the message box.

 



Silverlight 5 Hosting - ASPHostPortal :: Telerik Rad HtmlPlaceHolder in Silverlight 5 Via WCF Service

clock September 7, 2012 09:08 by author Jervis

Today, in this article let's concentrate on another Silverlight application, whereby communicating with a WCF Service to perform some operation.

The Telerik Rad Controls for Silverlight can be found from
http://www.telerik.com/products/silverlight/overview.aspx.

What is RadHtmlPlaceHolder?


In simple terms "It is the special controls which enables to render external WebPages into Silverlight App".


Let's get this implemented practically for a better idea of this!!!


Step 1: The complete code of the IService1.cs looks like this:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace Wcf_RadPlaceHolder
{

     // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
     [ServiceContract]
     public interface IService1
     {

          [OperationContract]
          string url(string a);
     }
}


Step 2: The complete code of the Service1.svc.cs looks like this:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace Wcf_RadPlaceHolder
{
     // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
     public class Service1 : IService1
     {
          public string url(string a)
          {
               return a;
          }
     }
}


Step 3: The complete code of the Web.Config looks like this
:

<?xml version="1.0"?>
<configuration>

   <system.web>
      <compilation debug="true" targetFramework="4.0" />
   </system.web>
   <system.serviceModel>
      <behaviors>
        <serviceBehaviors>
          <behavior>
             <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
             <serviceMetadata httpGetEnabled="true"/>
             <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
             <serviceDebug includeExceptionDetailInFaults="false"/>
          </behavior>
         </serviceBehaviors>
      </behaviors>
      <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
   </system.serviceModel>
   <system.webServer>
      <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>

</configuration>


Step 4: The complete code of the Clientaccesspolicy.xml looks like this (to avoid a cross domain problem in Silverlight):


<?xml version="1.0" encoding="utf-8"?>
<access-policy>
   <cross-domain-access>
     <policy>
       <allow-from http-request-headers="SOAPAction">
         <domain uri="*"/>
       </allow-from>
       <grant-to>
         <resource path="/" include-subpaths="true"/>
       </grant-to>
      </policy>
   </cross-domain-access>
</access-policy>


Step 5: The complete code of the MainPage.xaml looks like this:


<UserControl x:Class="RadPlaceHolderApplication.MainPage"
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
              xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006
              xmlns:telerik=http://schemas.telerik.com/2008/xaml/presentation
              mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
       <Grid x:Name="LayoutRoot">
            <telerik:RadHtmlPlaceholder x:Name="placeHolder1"
                                        ScrollViewer.HorizontalScrollBarVisibility="Visible"
                                        ScrollViewer.VerticalScrollBarVisibility="Visible"
                                        Margin="11,74,13,0" />
        <TextBlock Height="23"
                   HorizontalAlignment="Left"
                   Margin="34,16,0,0"
                   Name="textBlock1"
                   Text="Please Enter Web URL: "
                   FontFamily="Verdana"
                   FontSize="15"
                   VerticalAlignment="Top" />

        <TextBox Height="23"
                 HorizontalAlignment="Left"
                 Margin="219,16,0,0"
                 Name="textBox1"
                 VerticalAlignment="Top"
                 Width="212" />

        <Button Content="Go"
                Background="DeepSkyBlue"
                FontFamily="Verdana"
                FontSize="15"
                Height="23"
                HorizontalAlignment="Left"
                Margin="429,15,0,0"
                Name="button1"
                VerticalAlignment="Top"
                Width="75"
                Click="button1_Click"/>
    </Grid>
</UserControl>


Step 6: The complete code of the MainPage.xaml.cs looks like this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;
using RadPlaceHolderApplication.ServiceReference1;

namespace RadPlaceHolderApplication
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void url_Call(object sender, urlCompletedEventArgs e)
        {
            placeHolder1.SourceUrl = new Uri(e.Result.ToString(), UriKind.RelativeOrAbsolute);
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(textBox1.Text))
            {
                MessageBox.Show("Please Enter Some Values", "RadHtmlPlaceHolder- WCF", MessageBoxButton.OKCancel);
            }
            else
            {
                objClient.urlCompleted += new EventHandler<urlCompletedEventArgs>(url_Call);
                objClient.urlAsync(textBox1.Text);
            }

        }

        #region Instance Variables
        Service1Client objClient = new Service1Client();
        #endregion

    }
}

Step 7: The output of the application looks like this:



Step 8: The output of the Nothing Entered Application looks like this:




Step 9: The output of URL Entered Application looks like this:




Hope it helps!



Press Release – ASPHostPortal Launches ASP.NET 4.5 Hosting

clock August 10, 2012 08:59 by author Jervis

ASPHostPortal is a premiere web hosting company that specialized in Windows and ASP.NET-based hosting. Today, we are proud to introduce our new Microsoft product, ASP.NET 4.5 Hosting to all our new and existing customer. For more information about this new product, please visit ASPHostPortal official website at http://www.asphostportal.com.

As a response to today's technology development, ASPHostPortal.com provides customers with the option of the ASP.NET 4.5 hosting service. This newest version of .NET framework wills able users to manage and design web application faster. There are various features added such as, Page Meta Keyword and Description that will be very helpful for deploying SEO, AJAX, Visual Studio 2010 Support, IIS7 URL Rewrite, New ListView and DataPager Controls and WCF Support for RSS, JSON, POX and Partial Trust.

"This release is exciting as not only does it open the door for developers to stay ahead of the curve; it shows once again how ASPHostPortal.com is committed to being an industry leader,” said ASPHostPortal CEO, Robert Kruger. "You can get this new features on our shared hosting and also our reseller hosting."

“I’m very excited to see the latest Microsoft .NET Framework implemented on our infrastructure and to give our customers the opportunity to learn and experiment with the new features on our hosting environment." said Dean Thomas, General Manager of ASPHostPortal.com.

As a leading small to mid-sized business web hosting provider, we strive to offer the most technologically advanced hosting solutions available to our customers across the world. Security, reliability, and performance are at the core of our hosting operations to ensure each site and/or application hosted on our servers is highly secured and performs at optimum level.

For more details about this product, please visit http://asphostportal.com/Cheap-ASPNET-45-Hosting.aspx.



ASP.NET MVC 4 Hosting - ASPHostPortal :: AllowAnonymous Attribute and Authorize Attribute in ASP.NET MVC 4

clock August 6, 2012 07:32 by author Jervis

In this article, I will discuss one new features in ASP.NET MVC 4, AllowAnonymous Attribute. This feature helps you secure an entire ASP.NET MVC 4 Website or Controller while providing a convenient means of allowing anonymous users access to certain controller actions, like the login and register Actions. If you look at the AccountController in a default ASP.NET MVC 4 Internet Project you will see AllowAnonymous Attributes sprinkled throughout various login and register controller actions for this very reason.

AllowAnonymous Attribute in ASP.NET MVC 4

As mentioned, if you create a new ASP.NET MVC 4 Internet Project in Visual Studio 2010 or Visual Studio 11 and view the AccountController you will notice the generous use of the AllowAnonymous Attribute on various login and register controller actions. Here are a few of those controller actions.

[Authorize]
public class AccountController : Controller {
  [AllowAnonymous]
  public ActionResult Login() {
    // ...
  }

  [AllowAnonymous]
  [HttpPost]
  public JsonResult JsonLogin(LoginModel model, string returnUrl) {
    // ...
  }

  [AllowAnonymous]
  [HttpPost]
  public ActionResult Login(LoginModel model, string returnUrl) {
    // ...
  }

  [AllowAnonymous]
  public ActionResult Register() {
    // ...
  }

  [AllowAnonymous]
  [HttpPost]
  public ActionResult JsonRegister(RegisterModel model) {
    // ...
  }

  [AllowAnonymous]
  [HttpPost]
  public ActionResult Register(RegisterModel model) {
    // ...
  }
}

The idea is pretty simple. The Authorize Attribute on the AccountController in this ASP.NET MVC 4 Application denies anonymous access to every controller action. However, we need to allow anonymous access to the login and register controller actions so we decorate them with the AllowAnonymous Attribute which negates the Authorize Attribute and allows anonymous access.

Securing Entire ASP.NET MVC 4 Website with Global Filters

RegisterGlobalFilters(GlobalFilterCollection filters) {
  filters.Add(new HandleErrorAttribute());
  filters.Add(new System.Web.Mvc.AuthorizeAttribute());
}

You need to specify System.Web.Mvc with the Authorize Attribute because you will find an AuthorizeAttribute in System.Web.Http, too. This now secures every controller action in the entire ASP.NET MVC 4 Website except for those that use the AllowAnonymous Attribute.

Authorize Attribute and OnAuthorization Method

I was curious as to how the AllowAnonymous Attribute in ASP.NET MVC 4 was able to bypass the
Authorize Attribute, and the answer is in the Authorize Attribute's OnAuthorization Method. The OnAuthorization Method of the Authorize Attribute looks for an AllowAnonymous Attribute on the action or the controller and bypasses authorization if this is the case.

Here is a snippet of the OnAuthorization Method:

if (!filterContext.ActionDescriptor.IsDefined
    (typeof(AllowAnonymousAttribute), inherit) &&
  !filterContext.ActionDescriptor.ControllerDescriptor.IsDefined
    (typeof(AllowAnonymousAttribute), true)) {
      // Check for authorization
}

Essentially skip authorization if you find an AllowAnonymous Attribute on the action or controller.

Find ASP.NET MVC 4 hosting with ASPHostPortal.com. Starts from ONLY $2.00/month.



SQL 2012 Hosting - ASPHostPortal :: SSRS with SQL Server 2012 Denali and Sharepoint 2010

clock July 27, 2012 06:20 by author Jervis

In the new SQl server 2012 Denali SSRS is integrated in SharePoint 2010 as a Service application. This has few benefits over the old SSRS

- Easy deployment of SSRS reports in SharePoint 2010 server.

- Since SSRS is an Service application and now has its own database (like any other service application database).
- Administrators can now perform all the day-to-day activities like backup\restore of SSRS applictaion database, checking uls logs using Powershell etc.
- Supports WCF and Claims based Communication, built-in Scale with load balancing, PowerShell commandlets and cross-farm report consumption.
- Alerting is a new capability that has been introduced to Denali Reporting Services. You can now setup alert rules and be alerted when report data changes occur that match a set of rules.
- Denali is using Visual Studio 2010 so new reports can be build in Visual studio 2010 and published to SharePoint

Once you have configured SSRS service application you can use various available tools to create and Publish interactive reports in SharePoint 2010. Lets look at some of these tools


Report Builder 3.0
- Report Builder 3.0 is a tool which is Integrated in Denali and is used for creating and Publishing Interactive reports to a Reporting server like SharePoint.You can quickly start building reports in Report Builder by creating and publishing report parts,shared dataset, Creating Table, Matrix, Chart wizard or using Map wizard to create aggregated data reports into the SharePoint server.

Report Builder and SharePoint 2010
- When SSRS is integrated with SharePoint “Report Builder” is available as a Content type. You can create a library and start using Report Builder as a content type in your library.

Creating a new report with Report builder Content Type
– Once you add the “Report builder” content type to your library you can simple launch the Report builder tool\wizard by New Document item menu on the Ribbon and select “Report Builder Report”.

Power View or Project Crescent
- Power View is feature of Microsoft SQL Server 2012 Denali which serves as an Add-in for Microsoft SharePoint Server 2010 Enterprise Edition to build reports with an excellent data exploration, visualization, and presentation. Project Crescent runs in the browser and is working against a BI Semantic Model (BISM). BI Semantic Model is available on the client through the Excel based Power pivot modeling tool or on the server through Analysis Services Tabular project with SQL Server Denali.

Check Out the System Requirements for Power View Here.

Lets look at some of the advantages of using this new tool -


- Power View is a thin web client that launches right in the browser from a tabular model in SharePoint Server 2010.

- In Power View you’re working with the real data.
- You can simply drag-drop various controls to Power View designer and create presentable reports in minutes.
- In Power View, you can quickly create a variety of visualizations, from tables and matrices to bubble charts and sets of small multiple charts.
- Project Crescent is optimized for design and online screen consumption and interactivity.

Now, you can get all new features in SQL 2012 Hosting with us. Click
here to visit our site.



SQL 2012 Hosting - ASPHostPortal :: New T-SQL Features in SQL Server 2012

clock July 17, 2012 09:17 by author Jervis

Paging Data

Paging is a big issue for developers as it is required for many applications but entails many performance problems. Developers have used different workarounds to support paging.

For example, assume we need to display several pages of the HumanResource.Employee object with 5 rows per page. Below is the query you need to execute this in SQL Server 2012.

DECLARE @page_index SMALLINT ,
@page_Size SMALLINT = 5,
@offset INT
SET @page_index = 2
SET @offset = ( (@page_index - 1) * @page_Size)
SELECT   BusinessEntityID,
         NationalIDNumber,
         JobTitle
FROM HumanResources.Employee
ORDER BY BusinessEntityID

OFFSET @offset ROWS
FETCH NEXT @page_Size ROWS ONLY

In this query you will note that there are two additional syntaxes added to the well-known SELECT query.

OFFSET <offset> ROWS

The number of rows to exclude from the top.

FETCH NEXT <page_size> ROWS ONLY

The number of rows to display.

So in the results you will only receive the data you need.



You must remember that ORDER BY clause is a must, you can have multiple columns for the ORDER BY clause.


SELECT SOH.SalesOrderID

       ,SOD.SalesOrderDetailID
       ,P.Name As ProductNam
       FROM
Sales.SalesOrderDetail SOD INNER JOIN Sales.SalesOrderHeader SOH

ON SOD.SalesOrderID = SOH.SalesOrderID

INNER JOIN Production.Product P ON P.ProductID = SOD.ProductID

ORDER BY SOH.SalesOrderID,SOD.SalesOrderDetailID DESC

OFFSET 100 ROWS

FETCH NEXT 25 ROWS ONLY


The query plan for this will appear as below:




As you can see, the Top operator will be introduced at an almost zero percent cost.


Lag & Lead

This is another T-SQL feature added to SQL Server 2012 addresses an issue in reporting.


Let me describe this feature with a real world example.

Below are the sales amounts for one month.



The above data was generated from the FactInternetSales table in the AdventureWorksDWDenali database. You can find the same script in the 5528EN _02_03.sql file in the code folder.


For reports you need this month’s sales and last month’s sales along with the difference between the two months.


If you were asked to write a query for this, you query would look like:


SELECT

 t1.Year,
 t1.Month,
 t1.SalesAmount as SalesAmountThisMonth,
 t2.SalesAmount as SalesAmountLastMonth,
 t1.SalesAmount - t2.SalesAmount SalesDifferent
FROM MonthlySales as t1

LEFT OUTER JOIN MonthlySales as t2

ON (t1.Year = t2.Year) AND (t1.Month = t2.Month+1)

ORDER BY Year, Month


You need to use LEFT OUTER JOIN as INNER JOIN will not give any rows for the very first month in the data set.


Obviously, there will be a either an index scan or a table scan (depending whether you have an index or

not) twice for the table which is costly.

With SQL Server 2012, the new T-SQL function LAG is introduced just to address the above scenario:


SELECT

 Year,
 Month,
 SalesAmount as SalesAmountThisMonth,
 LAG(SalesAmount, 1, NULL) OVER(ORDER BY Year, Month) as SalesAmountLastMonth,
 SalesAmount - LAG(SalesAmount, 1, 0) OVER(ORDER BY Year, Month) SalesDifferent
FROM MonthlySales


As shown in the above example, the
LAG analytical function has three parameters. The first parameter is the expression which is the column in this scenario. The second parameter is the offset, since we are looking for last month this parameter is 1. If you want the last year’s comparative month’s data to be displayed then this parameter should be 12. The third parameter is the default, in case there is no match for the previous month, default value will be displayed.

So the output of the above query will be:




So how does this new syntax compare with the pre-2012 syntax? The simple way to compare them is running both queries in one batch and check the execution plan as shown in the below image. In the batch, the first query is the old style query and second query is the one using the
LAGfunction.



Relative cost wise, the first query (old style LEFT OUTER JOIN) cost is 77% whereas the query which contains
LAG cost is 23%. These queries were analyzed for Reads and duration using the SQL Profiler.

Below are the results for both queries executed after clearing the cache.


Reads

Duration (ms)

LEFT OUTER JOIN

125

8

LAG

46

3

Obviously using LAG has a clear performance advantage. However, to achieve better performance you need to cover those columns (in the above scenario, it will be Year and Month).

You can also use the
LAG function for grouping. For example, if you want product model sales differenciated by name you could use the below query.

SELECT

 ModelName,
 Year,
 Month,
 SalesAmount as SalesAmountThisMonth,
 LAG(SalesAmount, 1, NULL) OVER(PARTITION BY ModelName ORDER BY Year, Month) as SalesAmountLastMonth,
 SalesAmount - LAG(SalesAmount, 1, 0) OVER(PARTITION BY ModelName ORDER BY Year, Month) SalesDifferent
FROM ModelNameWiseMonthlySales


And the result is:




From the above results, you will see that the Sales Amount for the previous month is taken only for the model name.


LEAD
is another new function which is similar to LAGbut instead shows the future records.

SELECT

 Year,
 Month,
 SalesAmount as SalesAmountThisMonth,
 LAG(SalesAmount, 1, NULL) OVER(ORDER BY Year, Month) as SalesAmountLastMonth,
 LEAD(SalesAmount, 1, NULL) OVER(ORDER BY Year, Month) as SalesAmountNextMonth
FROM MonthlySales


As you can see from the below screenshot, the above query will give you the previous month’s and next month’s sales values in a single query.




FIRST_VALUE & LAST_VALUE


FIRST_VALUE
will return the first value while LAST_VALUE will return the last in an ordered set of values in SQL Server 2012.

Take for example, the below query.


SELECT

d.LastName,

d.GroupName,

e.JobTitle,

e.HireDate,

FIRST_VALUE(e.HireDate) OVER (PARTITION BY d.GroupName  ORDER BY e.JobTitle)
AS FirstValue,

LAST_VALUE(e.HireDate) OVER (PARTITION BY d.GroupName  ORDER BY e.JobTitle)
AS LastValue

 FROM HumanResources.Employee e
INNER JOIN HumanResources.vEmployeeDepartmentHistory d

ON e.BusinessEntityID = d.BusinessEntityID


This query will join the HumanResources.Employee table and the HumanResources.vEmployeeDepartmentHistory view together via BusinessEntityID. You can see that LastName, JobTitle, GroupName and Hiredate are selected from either the table or the view.


If you closely look at the
LAST_VALUE and the FIRST_VALUE function, you will observe that the Partition column and the order by column (Which are HireDate and GroupName respectively) are the same.

FIRST_VALUE
will give you the first value of the hiredate for each group when it orders by job title.

The results are given below:




CUME_DIST / PERCENT_RANK

CUME_DIST
and PERCENT_RANK can be used to calculate the relative rank of a row within a group of rows in SQL Server 2012.

Use PERCENT_RANK to evaluate the relative standing of a value within a query result set or partition.

PERCENT_RANK = (RANK() – 1) /

(TotalRows – 1)


CUME_DIST calculates the relative position of a specified value in a group of values.


The below example displays the Rank,
PERCENT_RANK and CUME_DIST

SELECT SalesOrderID,
 RANK() OVER(ORDER BY SalesOrderID) RANK,
 PERCENT_RANK() OVER(ORDER BY SalesOrderID) AS PERCENT_RANK,
 CUME_DIST() OVER(ORDER BY SalesOrderID) AS CUME_DIST
 FROM Sales.SalesOrderDetail
 WHERE SalesOrderID IN (75121,75122,75123 )

The result for the above query is shown below:



IIF

I’m not sure why the
IIF function which is a very simple function has not been included in previous versions of SQL Server. IIF is similar to the CASE function but it is optimized for evaluating two values. For example:

SELECT PersonType,

IIF(PersonType = 'EM','Employee','Other') PersonType

FROM Person.Person


The above query will return an Employee for the rows where PersonType equals EM and Other if not.


CHOOSE

This new simple feature is useful for extracting data elements from a data array:


DECLARE @MonthNumber int = 5
SELECT CHOOSE(@MonthNumber, 'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC') AS Month

The above will return the 5th element from the above array which is MAY.

TRY_CONVERT

The CONVERT function was used for earlier versions of SQL Server.

Let us say, we have a table with dates.

INSERT INTO MyData

(MyDate)

VALUES

('2011-01-01'),

('2012-12-31'),

('2012-02-29'),

('2011-02-29')


Note that 2011-02-29 is an invalid date. You could use
CONVERT function to convert varchar to the date data type:

SELECT CONVERT(date,MyDate) Mydate

FROM MyData

However, will return an error since you have an error in the last row. In SQL Server 2012, you can use the new feature,
TRY_CONVERT.

SELECT TRY_CONVERT(date,MyDate) Mydate

FROM MyData

TRY_CONVERT will return all the correct rows and invalid row will return null value. Main important thing is this won’t trigger an exception which will fail.

Apart from this you can use TRY_CONVERT function to retrieve only the error records.

SELECT MyDate

FROM MyData

WHERE TRY_CONVERT(date,Mydate) IS NULL


Instead of throwing an error TRY_CONVERT returns a NULL value and you can then more easily handle this in your code.


CONCAT

CONCAT is a significant addition for DQL Server developers.


If you have table with Title, FirstName, MiddleName, LastName columns and you may need to combine these columns and display them as a single column as shown below.

SELECT Title,FirstName,MiddleName, LastName ,
Title + ' '+ FirstName+ ' '+MiddleName+ ' '+LastName FullName
FROM Person.Person

Result are shown below:



However, except for three records and all the rows are null. That is because when a NULL value is added to a value the result is NULL.


The solution is to utilize the ISNULL function.


SELECT Title,FirstName,MiddleName, LastName ,

ISNULL(Title,'') + ' '+ FirstName+ ' '+ ISNULL(MiddleName, '' )+ ' '+LastName FullName

FROM Person.Person


However, this might be a tedious task if you have numerous columns to combine. In SQL Server 2012, you have a new function CONCAT which returns a string that is the result of concatenating two or more string values.


SELECT Title,FirstName,MiddleName, LastName ,

CONCAT(Title, ' ',FirstName, ' ',MiddleName, ' ',LastName) FullName

FROM Person.Person

From the below results you can see the null issue is eliminated in the FullName column.




Note that the
CONCAT function has no performance impact compared with the old-style syntax.

PARSE & TRY_PARSE

PARSE is somewhat similar to CONVERT in that it can convert one value to another specified value, however it should only be used for converting from a string to a date/time or number type. Note that since this is a CLR function it may have some performance impact.


SELECT PARSE('11/28/2011' AS datetime)
GO
SELECT PARSE('Monday, 28 November 2011' AS datetime USING 'en-US')
GO

As with TRY_CONVERT there is a function called TRY_PARSE to facilitate errors – ie it returns a NULL instead of throwing an error.

Date Time Functions

There are quite few date time functions introduced as shown in the below code. All the below functions will take parameters and generate datetime values from (except for DATEPART which outputs a part of a date as an integer).

SELECT
  DATEFROMPARTS(2012, 01, 31)   AS DATE_FROM_PARTS,
  DATETIME2FROMPARTS(2012, 01, 31, 15, 24, 5, 2, 7)  AS DATETIME2_FROM_PARTS,
  DATETIMEFROMPARTS(2012, 01, 31, 15, 30, 5, 997)   AS DATETIME_FROM_PARTS,
  DATETIMEOFFSETFROMPARTS(2012, 01, 31, 15, 30, 5, 1, -8, 0, 7)   AS DATETIMEOFFSET_FROM_PARTS,
  SMALLDATETIMEFROMPARTS(2012, 01, 31, 15, 30)   AS SMALLDATETIME_FROM_PARTS,
  TIMEFROMPARTS(15, 30, 5, 1, 7)    AS TIME_FROM_PARTS

All above functions will add different date parts and outputs will be given as a datetime.



EOMonth


In many human resource applications, you are required to get last date of the month. In previous versions of SQL Server, you might need to use following syntax.


SELECT

CAST(DATEADD(d,-1,(DATEADD(mm,DATEDIFF(m,0,GETDATE())+1,0)))AS DATE)

In SQL Server 2012 you can simply use EOMONTH to perform this:


SELECT EOMONTH(GETDATE())

There will not be any performance gain or loss since this function and the old-style function will both have same performance impact.



IIS 7.0 Hosting - ASPHostPortal :: How to Redirect HTTP to HTTPS

clock June 26, 2012 06:08 by author Jervis

Redirecting all traffic from HTTP to HTTPS in IIS7 will make sure your users always access the site securely. There are many different ways to set up an IIS7 Redirect from HTTP to HTTPS and some are better than others. The ideal HTTP to HTTPS redirect would do the following:

- Gently redirect users to HTTPS so users don’t have to type in “https” in the URL

- Redirect users to the specific page that they were going to go to on HTTP (page.htm)
- Save any variables passed in the query string (?page=2)
- Work in all browsers
- Transfer PageRank to the redirected page by using a 301 redirect, maintaining SEO
- Allow specific parts of a site to force SSL but allow HTTP on other parts of the site
- Redirect users from mydomain.com to www.mydomain.com

For me, this is two best method to redirecting HTTP to HTTPS in IIS 7.


Method 1 – Using Microsoft URL Rewrite Module

For this method of redirecting from HTTP to HTTPS, you will need to do the following;


1. Install the Microsoft URL Rewrite Module

2. Install your SSL certificate in IIS 7 and bind it to your website

3. Make sure Require SSL is NOT checked under SSL Settings for your website (uncheck the boxes that are checked in this screenshot)



4. Copy and paste the following code between the <rules> and </rules> tags in your web.config file in your website root directory.


<rule name="HTTP to HTTPS redirect" stopProcessing="true">

   <match url="(.*)" />
     <conditions>
       <add input="{HTTPS}" pattern="off" ignoreCase="true" />
     </conditions>
   <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
 </rule>

5. Test the site by going to http://www.yoursite.com and making sure it redirects


Method 2 – Setting up a Custom Error Page


The second method of setting up an IIS7 redirect HTTP to HTTPS is to Require SSL on the site or part of the site and set up a custom 403.4 error page. To do this, just following these steps:


1. Install your SSL certificate in IIS 7 and bind it to your website


2. In IIS, click on the site name, and go to the SSL Settings section




3. Check
Require SSL and Require 128-bit SSL and click Apply.



4. After doing this, you will normally get this error:




5. Create a new text file and paste the following into it:


<html>

 <head><title>Redirecting...</title></head>
 <script language="JavaScript">
 function redirectHttpToHttps()
 {
     var httpURL= window.location.hostname + window.location.pathname + window.location.search;
     var httpsURL= "https://" + httpURL;
     window.location = httpsURL;
 }
 redirectHttpToHttps();
 </script>
 <body>
 </body>
 </html>

6. Save the file as
redirectToHttps.htm in your C:\Inetpub directory

7. Back in IIS, click on the site name and double-click the
Error Pages option



8. Click
Add… and enter 403.4 as the Status code. Browse for the redirectToHttps.htm file you just created and click OK



9. Select the error code and press
Edit Feature Settings



10. Click the
Custom error pages option and again browse for the redirectToHttps.htm file



11. Test the site by going to http://www.yoursite.com and making sure it redirects


A caveat of using a custom error page to do an IIS7 redirect from HTTP to HTTPS is that the web browser must have JavaScript enabled for the redirection to work.


Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.


You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:


-
DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.

- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.

- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.

- Data Center

ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.

- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.

- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.

- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



Silverlight 5 Hosting - ASPHostPortal :: How to Debug XAML Bindings in Silverlight 5

clock June 13, 2012 08:55 by author Jervis

The example demonstrated here implements basic XAML data binding. Below we have specified both the scenario when binding is correct and incorrect.

In below example we have given a simple binding for DataGrid.


When Binding is Correct:




Now you can apply a breakpoint to the binding syntax. Once the break point is applied, it hits the breakpoint whenever push and pull is triggered for that control. The below image shows the breakpoint applied within XAML




The XAML editor will not allow you to set breakpoint anywhere else other than Binding syntax.

Once Breakpoint is set, start debugging and wait for the compiler to hit the breakpoint.



You can find the debug information from Local tab.




The information shows up a BindingState object holding complete binding context information of the control. As in the above image, the BindingState value is UpdatingTarget so this way it shows that the binding is pushing data to control.


Going through the debugging information, it shows the complete picture on the nature of data and binding




Now another thing to know is, on TwoWay binding scenario once you change the data, The breakpoint again gets a hit as the binding source is getting updated. And the debug information shows the Binding state as Updating Source status. The breakpoint again gets a hit as the binding source is getting updated. And the debug information shows the Binding state as Updating Source status.




When Binding is Incorrect:


When binding is incorrect you will get the error while debugging the binding.




This will help you to find the incorrect bindings in your XAML.

Hope this helps you to get acquainted with the new feature of Silverlight 5

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what
ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.

- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.

- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.

- Data Center

ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.

- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.

- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.

- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



SQL 2012 Hosting - ASPHostPortal :: Restore Database Enhancements in SQL 2012

clock June 11, 2012 08:46 by author Jervis

In SQL 2012, Microsoft has introduced some nice restore database enhancements.
The major enhancements are:


1. Point-in-time restore has now a visual timeline that allows you to quickly select the target time and perform your restore.

2. Page Restore worked already in SQL 2008 (R2) and SQL 2005 but it has now a nice user interface. It allows you to check your database for corrupt pages and restore them from a good backup file.


In this blog, I’ll give you an overview how to use these 2 new features.

Point-in-time restore

In the Object Browser of your SSMS, right click on Databases and select “Restore Database”

In this example, I will perform a restore of the Adventureworks2008R2 database. I selected Device to get my backup files. Just press the […] button



In the locate backup file window, I select all the backup files (Full backups and Transaction Logs) that have been made. To create the backups, I just created a simple Maintenance Plan.

Click on OK.



Now all the backup sets are in the list (this is not new…). As you can see, there is a new button called “Timeline”. Click on it to open the timeline interface.




Now, you can choose to restore to the last backup taken or choose a specific date and time. With the timeline, you can scroll to the restore time that you want. On the timeline you can also see what types of backups will be used to perform the restore. Once you selected the correct time, just press the OK button.




Now press OK again, to start your restore. A restore plan is automatically generated and your database is restored till the requested time.






Page Restore

To perform a page restore,I first need to have a corrupt database and you also need to have a GOOD backup file,which means, without the corrupt page.
As you can see below, I did a DBCC checkdb and my database is indeed corrupt.



Let’s fix this database!

Right click on your DB, select Tasks – Restore – Page



In the Restore Page window, the database is selected and the Pages grid is automatically showing the damaged pages. You can also run DBCC CHECKDB, by clicking on the button “Check Database Pages”, to find out if there are more damaged pages in the database. You also need to set the location for the Tail-Log backup file. The Backup sets grid shows you all the backups that can be used to fix your pages.






Just click on the OK button to start the page restore




When I check my database again with DBCC CHECKDB I see that the damaged page has been fixed




I think those 2 new features will make the life of the DBA just a little bit easier


Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what
ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.

- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.

- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.

- Data Center

ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.

- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.

- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.

- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.

 



About ASPHostPortal.com

We’re a company that works differently to most. Value is what we output and help our customers achieve, not how much money we put in the bank. It’s not because we are altruistic. It’s based on an even simpler principle. "Do good things, and good things will come to you".

Success for us is something that is continually experienced, not something that is reached. For us it is all about the experience – more than the journey. Life is a continual experience. We see the Internet as being an incredible amplifier to the experience of life for all of us. It can help humanity come together to explode in knowledge exploration and discussion. It is continual enlightenment of new ideas, experiences, and passions

 photo ahp banner aspnet-01_zps87l92lcl.png

Author Link

Corporate Address (Location)

ASPHostPortal
170 W 56th Street, Suite 121
New York, NY 10019
United States

Sign in