Windows 2012 Hosting - MVC 6 and SQL 2014 BLOG

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

SQL SERVER 2014 Hosting - ASPHostPortal :: How to use Output Parameters in SQL Server and ASP.NET

clock May 4, 2015 05:57 by author Mark

The out parameters in SQL Server, when used in Stored Procedures, allow developers to pass a value in the database to the front-end controls like label. They are most commonly used in web application development.
Let us discuss how to create and use them in ASP.Net with a practical example. First we will design our database.

  • Create a database in SQL Server.
  • Let us create a table with three columns, say username, password and confirmation password.

Create table logintable(username varchar(max),password varchar(max),confirmpassword varchar(max))

  • Let us create our Stored Procedure.

Here we have created a Stored Procedure named usplogintable with username, password and confirmpassword as input parameters. The next variable that I have created is the @error variable of varchar type. You can see the keyword "out" near the varchar. Yes, your guess is correct, the keyword "out" stands for the output parameter in SQL Server.

We will execute this Stored Procedure as a batch so we have begins and ends. Then, "set nocount on" avoids returning the number of rows affected.
The if condition checks whether the username exists in a database and if the answer for it is yes, the @error variable is set with the username already taken or it inserts the values into the table and sets the @error variable as the username inserted.

Executing the Stored Procedure also requres a different style. First you need to declare a variable, you need to specify the output parameter on execution and you need to write a select query at the end to make it execute. Here is my sample for the preceding sp.

I have inserted the table with the values markus, mark and confirm password as mark.

  • I can guess what you are thinking. “How can I use it in my server-side code?”. Yeah, I am an ASP.Net developer and I have the solution for this. Here are the ways.

Additionally, you must also open your Visual Studio or press Ctrl+r and type devenv.
Create an ASP.Net web application with the framework being above 2.0. First create a form in ASP.Net with three labels and three textboxes with names as username.password and confirmpassword as shown in the screen below.

Okay. Let me take you through a tour of the server-side code on it. I will use ADO.Net here for the database connectivity. I will add my logic on my button click. Add using statements for the namespaces System.data and System.Data.SqlClient since these are not the default namespaces in .Net.

Add the following code by double-clicking the submit button.

  • Here I have created the connection string in my fashion and you can use your own style in your application as usual.
  • Thats it. We are done. Press Ctrl+F5.
  • If you provide the inserted usename.
  • And if you provide a new username, yuppy, it is inserted.

Best SQL Server 2014 Hosting Recommendation

ASPHostPortal.com provides our customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in SQL Server 2014 . We offers Windows hosting starts from $5/month only. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable SQL SERVER 2014 Hosting, we should be your best choice.

 



Windows 2008 Hosting with Free ASP.NET :: 9 Steps to Solve Login Failed Error : 18456 in Microsoft SQL Server 2008

clock April 23, 2015 07:31 by author Dan

In this posting, I'll coach you on how you can figure out what user features administrative legal rights within the server along with walk you Step-By-Step how you can configure SQL Server permitting some other end users to sign in as Administrators to SQL Server. This simple information “Login Failed for User (Microsoft SQL Server, Error: 18456)” indicates anyone came into unacceptable recommendations as soon as logging into SQL Server. Inside the beneath display screen chance, We are logging into 'microsoft' SQL Server Managing Facilities which has a user that will not have administrative permissions for connecting to the server.

You must to decide what user is equipped with privileges to SQL server. Normally this can be a user which you logged with having once you put in SQL Server or the user that is the default owner on computer. To obtain a set of user on the unit (Assuming Microsoft windows Server 2012 or above).

Step-By-Step

Launch Server Manager – Start – Click Server Manager



In the upper right corner, click Tools, then Computer Management



Expand Local Users and Groups (Under Computer Management-System Tools) then click Users

Notice under Description… There is a Built-in account for administering… This is very likely an account that has access to SQL server.  Try logging onto windows with that account that is Built-in account for administering then we can grant rights to the user you want to use to login to SQL Server.



Now that you are logged into Windows with an account that has access to connect to SQL Server, Let’s go in and grant rights to the user that you want to be able to use to access SQL Server.

Step-By-Step

Launch SQL Server Management Studio again and you should be able to Connect

Expand your ServerName, then Expand Security, then Logins.  Click Logins

Right-Click Logins Select New Login



Click the Search Button

Type in the Windows User Name you would like to add as an SQL Administrator then click Check Names  (or you can click advanced and select from a list)



Click Server Roles in the left pane; then turn on the sysadmin checkbox, then click OK



You can then confirm you have sa rights by double-clicking the user name in the left Object Explorer and clicking on Securables



Now you can log out of Windows, login as the user you just granted rights to and all should work fine.

Best Windows Server 2008 Hosting Recommendation

ASPHostPortal.com provides our customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server 2008. We offers Windows hosting starts from $5/month only. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable Windows server 2008 Hosting, we should be your best choice.



Reporting Services Hosting with ASPHostPortal :: Integrating Reporting Services Into a Web Application

clock April 4, 2014 13:12 by author Kenny

With Visual Studio you can be easier to integrate SQL Reporting Services into ASP.NET web applications. Now, i will explain about how to integrate Report Services into a web application using Visual Studio.

First, you must create a new project in Visual Studio, in the ASP.NET code, you will need to delete (or change) this line:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Next replace any existing code between the <form> tags with the below code:
<table style="vertical-align: bottom; border-width: 0px; margin-top: 0px;
   margin-bottom: 0px; width: 100%; height: 100%; padding: 0px,0px,0px,0px;"
   cellspacing="0" cellpadding="0">
    <tr>
        <td>
            HEADER
        </td>
    </tr>
    <tr>
        <td>
            <div style="border-top: black 1px solid;
                background-color: #ece9d8; border-bottom-width: 1px;
                border-bottom-color: #d4d0c8; padding-bottom: 10px;">
                Custom Controls
            </div>
       </td>
    </tr>
    <tr>
        <td style="height: 100%;">
            <%-- This is where the ReportViewer control will go. --%>
        </td>
    </tr>
</table>


Switch to the “Design” view since it is now time to add the ReportViewer control.
In the “Data” section within the Toolbox, drag the ReportViewer control onto the last row of your table, which should be taking up most of the page. Next you want to set the control’s properties so that it points to the right server and the right report. Under properties, go to the “Server Report” section. Right above the section you should see a property called “ProcessingMode”. In most cases you are going to want use an instance of a Report Server. So for the purposes of this tutorial, set this property to “Remote”, even if the Report Server instance is on the same computer as your web app. Next, you want to set the “ServerReport” settings.

First, type in address of the Report server in the “ReportSeverUrl” field.
The syntax is:
http:// NameOfServer / reportserver
i.e. http://ServerOne/reportserver

Next type in the location of the report in the “ReportPath” field.
i.e. /MyReports/TheReport

The location is easy to know since it is the same path structure that you see in the Report Manager. Also, always be sure the put a forward slash first before the actual path.

Unless you want the ReportViewer to be an absolute size, go ahead and set the height and width settings under the “Layout” section to be 100%. The ReportViewer will by default show controls to set the parameters for the report. These often look a little ugly, and I would recommend most developers to create their own parameter controls. This can be done in the control bar row of the template provided above. To get rid of the ReportViewer’s parameter controls set the “ShowParameterPrompts” in the properties underneath “Appearance” to false. In, the next section I’ll show how you can set the report parameters with your own code.

Those should be all the settings you need to make for the ReportViewer to display correctly, unless your version of Visual Studio has other default settings. Double check to make sure the ASP.NET looks similar to this code:
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Height="100%"
    ProcessingMode="Remote" ShowParameterPrompts="False" Width="100%">
    <ServerReport ReportPath="/MyReports/TheReport" />
</rsweb:ReportViewer>

Now, the report is ready to be processed. You can go ahead and preview your website and the report should generate just fine.



Free SQL Server Hosting :: How to Handle Error : 1326 Cannot connect to Database Server Error: 40 – Could not open a connection to SQL Server

clock January 21, 2014 05:19 by author Ben

If you are receiving following error:

TITLE: Connect to Server
Cannot connect to Database Server.
ADDITIONAL INFORMATION:
An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2008, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 1326)


Now if
SQL Server can be connected perfectly from local system but can not be connected from remote system, in that case firewall of the server where SQL Server is installed can be issue.

Follow instructions of this article to fix the issue.

Go to control panel >> Firewall Settings >> Add SQL Server’s Port to Exception List.



Click Add Port and fill this :


Now try to connect to SQL Server again. It will allow you to connect to server successfully.

About the Company
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.com strive to offer the most technologically advanced hosting solutions available to  all customers across the world.
Come to the website to know more details.

 



Windows Server 2012 Hosting - ASPHostPortal.com :: Import IP Address with IPAM into Windows Server 2012

clock November 21, 2013 07:17 by author Ben

IPAM leverages an intuitive point- and-click web interface to allow you to Easily investigate the IP address space issues . By scanning the network , IPAM maintains a dynamic list of IP addresses and Allows engineers to plan for network growth , Ensure IP space usage meets corporate standards , and reduce IP conflicts .

IPAM is an entirely new feature in Windows Server 2012 that provides highly customizable administrative and monitoring capabilities for the IP address on a corporate network infrastructure or IPAM is the new framework for finding , monitoring and managing it on a network .

IPAM is a feature of Windows Server 2012 and must be installed as such , either by using the Add Roles and Features Wizard or through PowerShell 3.0 and poorly documented in my opinion , making a useful feature harder to use and understand than it should be .

Even without formal organization IPAM applications keep track of their IP address information somehow - most typically in spreadsheets . IPAM lets you view IP address availability and configuration from a database perspective , enabling you to use your addresses more efficiently . IPAM features such as IP reconciliation and automation can Eliminate the need to use spreadsheets for tracking addresses .

IPAM is performed on a Microsoft network by an installable feature of Windows Server 2012 that you run on a domain member server to " watch and centrally manage " the other servers on your network that are actually doing the work . IPAM manages the functionality of the following Windows servers :

  • DHCP Service
  • DNS Server
  • Network Policy Server ( NPS )
  • Active Directory Domain Controller ( DC )


To do import IPAM , IPAM log on to your server and open Server Manager :

  • Click IPAM in far left pane of Server Manager .
  • In the IPAM client , select IP Address Blocks under IP ADDRESS SPACE , and the make sure that Current view is set to IP Addresses in the drop - down menu .
  • If you look along the top window , you will see the IP address listed along the top fields , such as IP Address and IP Address State . You can add or remove fields by right-clicking on one of the existing fields .


If you want to import and Assignment Type yhis information , you need to add these fields to the first line of your import file , without spaces , as shown below :

IPAddress , IPAddressState , AssignmentType , ManagedByService , ServiceInstance , AssetTag

10.160.50.12 , In - Use , Static , IPAM , localhost , BR12

10.160.50.13 , In - Use , Static , IPAM , localhost , BR13

10.160.50.14 , In - Use , Static , IPAM , localhost , BR14

10.160.50.15 , In - Use , Static , IPAM , localhost , BR15

Alternatively , you can keep the spaces in the field names and enclose with quotation marks , for example , " IP Address" and " IP Address State " . The actual IP address of the data should then follow , comma delimited in the same order that you specified the fields as shown above .

Some fields , such as IP Address State , will require you to look and see what the options are valid input . To find out what the possible options are :

Click Tasks in the far right corner of this client and select Add IP Address from the menu .

Select the drop - down menu by the side of the field to see the possible options. For instance , the field can be set to In - Use , Inactive or Reserved .

Now we need to change the status of any discovered servers to Managed . To do this , right click a server in the Server Inventory screen and select Edit Server from the menu .

In the Add or Edit Server window , change the Manageability status to Managed and click OK . Right click the server again , and select Retrieve All Data Server from the menu . Repeat this procedure for all discovered servers . Now you are ready to add the IP addresses , ranges and blocks to IPAM .



Visual Studio 2010 Hosting :: Deploying a WPF Application Using Click-Once Deployment Technology in Microsoft Visual C# 2010 Express

clock November 14, 2013 05:07 by author Ben

Click -Once Enables Web - style application deployment for non - web applications. Applications are published to and deployed from a web or file servers . Although Click Once does not support the full range of features that client applications installed by the Windows Installer does , it does support a subset that includes the following :

  1. Integration with the Start menu and Programs Control Panel .
  2. Versioning , rollback , and Uninstallation .
  3. Online install mode , that always launches an application from the deployment location .
  4. Automatic updating when new versions are released.
  5. Registration of file extensions .

Before proceeding for the deployment , Ensure that your application has been built properly and ready for the deployment . Explains this article with respect to Game in a WPF and the game name is Mr . Gunner .

1.
In Solution Explorer, right-click the project name and select "Properties" as shown in the following snapshot.



2. After clicking on Properties a Publishing Window will open and it has various options, such as Application, Built, Security, Publish and so on. as you can see in the following snapshot.



3. To set an icon for your application, browse for the suitable icon for your application. To set the icon, click on the application and browse the icon (the icon should be a .ico file) , if you don't want to set an icon  for the application then it will be deployed with a default icon in your application as I highlighted with red circles in the following snapshot.



4: Then click on "Publish". Here select the publishing location nothing but browse the folder where you want keep the setup file and other application files and after selecting the publish location then click on the "Publish Wizard" to proceed as shown in the highlighted red circles.



5. After clicking "Publish" a wizard window will open, then click on the "Next" button as shown in the following snapshot:



6.  After selecting CD-ROM or DVD then click "Next" to proceed as shown in the following snapshot:



7. After selecting "Updates" Click "Next" to proceed to the final step as shown in the following snapshot.



8. Now, finally click on the "Finish" button to complete the Publish Wizard as shown in the following snapshot.



Finally, a setup file has been created on the selected folder. Now you can install the application on your system by clicking on the setup file. Have fun working with the installed application.



Reporting Service (SSRS) 2008 Hosting :: SSRS Report Execution and Performance Enhancements

clock July 22, 2013 06:17 by author Mike

Reporting Service (SSRS) 2008 R2 allows us to execute reports in 3 modes:

  1. On Demand
  2. From Cache
  3. From Snapshots

 

On Demand

  • This is normal approach that we follow, by hitting a report server URL. Each time a report is run, data is returned from the database server and rendered to the report.
  • This approach ensures that our report is update and fresh.
  • The downside of this approach is that, if n users open up this report on their browsers, queries on the report are executed n times.
  • Thus this approach at times might slow down the server.

Cache

  • One of the performance enhancements techniques is to cache a report when it is initially run.
  • This means that if another user requests for the report, the same report is served to the user from the cache.
  • This avoids people querying the database server from each report rendering.
  • To make sure that people do not receive too much stale data, we can set a time to invalidate a cache.
  • This is a good performance enhancement technique for slow running reports.

Snapshots

  • Report snapshots are created at a particular schedule for certain parameters.
  • Please note that parameters cannot be changes on snapshot reports.
  • SSRS 2008 R2 allows to schedule the snapshot creation times.
  • Users can directly render a report from a snapshot. However please note that not all reports can have snapshots, especially the ones that prompt users for credentials.


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