Windows 2012 Hosting - MVC 6 and SQL 2014 BLOG

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

Silverlight 5 Hosting - ASPHostPortal :: Telerik RadBarCode in SilverLight 5 Via WCF Service

clock November 29, 2012 08:03 by author Jervis

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/controls.aspx.

The Rad Window is used to display the output in a nice and enhanced UI.

Question: What is RadBarCode?

In simple terms "It provides light weighted and easy systematic approach to generate bar-codes, it used to ensure unique id given to each product when evaluating".

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_Rad_Bar
{
    // 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]
        int bar(int 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_Rad_Bar
{
    // 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 int bar(int 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 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="Rad_Bar_App.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" Width="628" Height="452">
        <telerik:RadBarcode128 Name="radBar1"
                               ShowChecksum="False"
                               Margin="104,0,113,189"
                               Height="89"
                               VerticalAlignment="Bottom">
       </telerik:RadBarcode128>
        <TextBlock Height="23"
                   HorizontalAlignment="Left"
                   Margin="191,12,0,0"
                   Name="textBlock1" Text="Please Enter Bar Code Number"
                   FontFamily="Verdana"
                   FontSize="15"
                   VerticalAlignment="Top" />
         <TextBox Height="23"
                HorizontalAlignment="Left"
                 Margin="248,41,0,0"
                 Name="textBox1"
                 VerticalAlignment="Top"
                 Width="120" />
        <Button Content="Send BarCode"
                FontFamily="Verdana"
                Background="DeepSkyBlue"
                FontSize="15"
                Height="23"
                HorizontalAlignment="Left"
                Margin="235,82,0,0"
                Name="button1"
                VerticalAlignment="Top"
                Width="133"
                Click="button1_Click"/>
         <telerik:RadBarcode93 Name="radBar93"
                             Margin="104,336,113,22" ShowChecksum="False">
         </telerik:RadBarcode93>
       <TextBlock Height="23"
                   HorizontalAlignment="Left"
                   Margin="235,289,0,0"
                   Name="textBlock2"
                   Text="RadBarCode93"
                   FontFamily="Verdana"
                   FontSize="15"
                   VerticalAlignment="Top"
                   Width="170"
                   FontWeight="Bold"
                   Visibility="Collapsed"
                   /> 
        <TextBlock Height="23"
                   HorizontalAlignment="Left"
                   Margin="234,129,0,0"
                   Name="textBlock3"
                   Text="RadBarCode128"
                   FontFamily="Verdana"
                   FontSize="15"
                   FontWeight="Bold"
                   VerticalAlignment="Top"
                   Width="134"
                   Visibility="Collapsed"/>
    </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
Rad_Bar_App.ServiceReference1;
namespace
Rad_Bar_App
{    public partial class MainPage : UserControl
  {
        public MainPage()
        {
            InitializeComponent();
        }
       private void bar_Call(object sender, barCompletedEventArgs e)
        {
            radBar1.Visibility = System.Windows.Visibility.Visible;
            radBar93.Visibility = System.Windows.Visibility.Visible;
            radBar1.Text = e.Result.ToString();
            radBar93.Text = e.Result.ToString();
            textBlock2.Visibility = System.Windows.Visibility.Visible;
            textBlock3.Visibility = System.Windows.Visibility.Visible;
        }
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            textBlock2.Visibility = System.Windows.Visibility.Collapsed;
            textBlock3.Visibility = System.Windows.Visibility.Collapsed;
            radBar1.Visibility = System.Windows.Visibility.Collapsed;
            radBar93.Visibility = System.Windows.Visibility.Collapsed;
            if (string.IsNullOrEmpty(textBox1.Text))
            {
                RadWindow.Alert("Please Enter Some Values");
           }
            else
            {
                Service1Client obj_Client = new Service1Client();
                obj_Client.barCompleted += new EventHandler<barCompletedEventArgs>(bar_Call);
                obj_Client.barAsync(Convert.ToInt32(textBox1.Text));
                textBox1.Text = "";
            }
        }
    }
}


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 the BarCodeEntered Application looks like this.

 



SSRS 2012 Hosting - ASPHostPortal :: Permission in SSRS 2012

clock November 15, 2012 07:04 by author Jervis

Problem

As you begin developing reports for deployment to a Report Server, what security considerations need to be taken into account in order to grant users access to run a report.

Solution

Securing Reporting Services can be a daunting task for a rookie report developer. In this tip, we will focus on SQL Server Reporting Services 2012 (SSRS), although many of the items also apply to SSRS 2008 R2. Security consists of two main components: security and access at the Report Server level and authentication and permission at the data source level. Within this tip, we will cover Report Server Permissions first and then move on to database level security. Coverage of permission needed for a SSRS server in SharePoint integrated mode will be covered in a later tip.

SQL Report Server Permissions

Within the SSRS website, the first item to setup is to create system level permissions; these permissions are assigned to the main administrators of SSRS and the "power" users who publish reports. Similar to SSAS, SSRS uses a role concept. Two main roles, System Administrator and System User are predefined. Assignment to these roles is made by clicking on Site Setting in the upper right corner of the report server site;  next click on the Security link from the left menu.  Local and active directory groups and users can be assigned to either of these roles; however SQL Server logins cannot.

Clicking on the Edit option allows you to add, edit, or remove the roles assigned to the user or group as displayed in the below figure. Generally the System Administrator role is reserved for those who need to have full control over the Report Server whereas the System User role is applied to users / groups who are power users of the Report Server.

Moving beyond the system level roles, permissions must also be applied at the folder and report level on the Report Server. Similar to the System Assignments, a local or active directory user or group can be assigned to one or more roles. SSRS includes 5 predefined roles that should suffice in most circumstances. These roles include:

  • Browser-allows users to run reports and browse folders; this role will be used by most end users
  • Content Manager-allows users to manage and define folders and reports and to grant permissions
  • Report Builder-allows users to create Report Builder reports
  • Publisher-allows users to deploy / upload reports and create folders
  • My Reports-allows users to create and maintain personal MyReports folders

More details on each of these predefined roles can be found at: http://msdn.microsoft.com/en-us/library/ms157363.aspx.

In order to assign permissions to a report or folder, first select the desired report or folder and then click the down arrow on the right side of the report or folder name. Then select the security option from the left hand menu.

In the Group or User name textbox, enter the group or user name (prefixed with the appropriate domain if needed). Next, the appropriate role or roles must be selected and then last, click OK. As noted previously, most day to day users will only need the Browser role. Most high level power users will need to be assigned to either the Content Manager or Publisher role.

Some additional attention needs to directed to how permissions are inherited by subfolders and reports. First, the role assignments use a waterfall methodology. Thus, starting at the home page, all folders, subfolders, or reports underneath the home page in the hierarchy will have the same permission that are assigned to the home page UNLESS the permission chain is broken, either at the folder, subfolder, or report level. Clicking on the Edit Item Security button, as displayed below, will break the permission chain and allow for the customization of the security for that individual folder or report.

Selecting this option prompts the following warning to be displayed. After clicking OK, permissions must be maintained for that individual folder or report; changes to folders above this level including the home page are no longer utilized or considered.

Fortunately, if at some point you would like to go back to having your folder or report inherit its permission from a parent structure, you can click on the Revert to Parent Security button.

In addition to using the predefined roles in SSRS, customized roles can be created and used. Furthermore, the current set of the predefined roles can be altered; however, I highly recommend leaving the predefined roles as is, and create new roles with the appropriate permissions. Contrary to some older version of SSRS, in SSRS 2012, new roles and adjustments to existing roles must be performed in SQL Server Management studio, SSMS. After opening up SSMS, change the server type to Reporting Services, enter your Server Name, and login information and then click Connect. After connecting to the Report Server, open the Security Folder, as noted in the following screen print. Notice under the security tab, two Role Types Exist, one for the System Roles and one for the "regular user" Roles.

Right mouse clicking on Roles and Selecting New Role opens the New User Role window, which allows for the naming of the role and selection of particular tasks to assign to this new role.

Once created, these custom roles will now appear in the role assignment list as displayed in the below figure.

Once the SSRS report and folder level security has been planned and implemented, a second area of security must also be handled; as discussed next, this task centers around the security ramifications of the actual data itself and what access is granted to that data.

Database Level Security

For many DBA's and DWA's this second area of consideration is likely a more familiar topic. Specifically, for all data objects (ie tables, views, stored procedures) used in a particular report, the user running the report must have appropriate permissions to access the data and its related object (ie select permissions for tables and view and execute permissions for stored procedures). One decision that must be made early on in the report design process is whether the reporting user to be authenticated by SSRS will be a SQL Server Login or a Windows / Active Directory login. This decision is made in BIDS (Visual Studio 2010 using the Business Intelligence Development addin), specifically during the creation of the DataSource for the project, as noted in the below image.

The advantages of using Windows Authentication center around ease of maintenance and administration of the user whereas the use of the SQL Server login allows for the avoidance of the double hop issue ( see http://blogs.technet.com/b/rob/archive/2011/11/23/enabling-kerberos-authentication-for-reporting-services.aspx for details about the double hop issues).

Once the decision is made about which authentication method is used, the next step includes granting the appropriate privileges, whether to a windows user or group or a SQL Server login, for all objects involved in the dataset queries for the report. Of course these grants could include execute permissions on a stored procedure or select permissions for a group of tables and views.

Conclusion

Implementing SSRS Security requires a two step approach. Object permissions must be granted at the database level while SSRS folder and report level permissions requires that a user be assigned to one or more SSRS roles. Several predefined roles exist and will suffice for much of your permission needs. However, customized roles can also be generated.



Press Release - ASPHostPortal.com Announces Newest Support for SharePoint 2013 Hosting

clock November 13, 2012 05:55 by author Jervis

ASPHostPortal.com is a premiere web hosting company that specializes in Windows and ASP.NET-based hosting, proudly announces the new Microsoft product, SharePoint 2013 hosting to all new and existing customers.

As in the SharePoint 2010 product line, SharePoint 2013 Foundation is the core platform of the product. SharePoint 2013 comes with enhancements to the administration and user experience, plus new options for enterprise users to collaborate using social media features. SharePoint Server 2013 is basically Foundation with additional Enterprise services and functionality added on top. You will still get Central administration, basic search, document collaboration, and team sites with Foundation. Here are some new features in SharePoint 2013:

- SharePoint 2013 will bring richer themes and even the ability to add a background image to the page.

- Social capabilities in SharePoint 2013: micro blogs, activity feeds, community sites, following, likes and reputations, etc
- Clearly recognizing the massive rise in use of mobile smart devices, Microsoft has done some nice work to make it easier to access SharePoint content from a mobile device.
- Everything is considered an “App” including lists and document libraries. Microsoft is seemingly ready to go after Apple’s thunder.
- Document collaboration is now built into the team site template.

“With this new release of SharePoint 2013, entrepreneurs and organization will be able to build their impressive website to be on the top of the competition. New features like social capabilities make it easy to share ideas and discover experts you never knew existed.” Said Dean Thomas, Manager at ASPHostPortal. “We pride ourselves on offering the most up to date Microsoft services. We're pleased to launch this product today on our hosting environment.”

ASPHostPortal is one of the Microsoft recommended hosting partners that provides the most stable and reliable Windows web hosting platform. With the new launch of SharePoint 2013 into its feature, it will continue to keep ASPHostPortal as one of the front runners in the web hosting market. For more information about this product, please visit http://www.asphostportal.com.

About ASPHostPortal.com:

ASPHostPortal.com is a hosting company that best support in Windows and ASP.NET-based hosting. Services include shared hosting, reseller hosting, and SharePoint hosting, with specialty in ASP.NET, SQL Server, and architecting highly scalable solutions. As a leading small to mid-sized business web hosting provider, ASPHostPortal strive to offer the most technologically advanced hosting solutions available to all customers across the world. Security, reliability, and performance are at the core of hosting operations to ensure each site and/or application hosted is highly secured and performs at optimum level.

 



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


Author Link


Corporate Address (Location)

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

Sign in