ASP.NET 4.5 and ASP.NET Core 1 Hosting BLOG

Tutorial and Articles about ASP.NET 4.0 and the latest ASP.NET 4.5 Hosting

ASP.NET Hosting Tips - ASPHostPortal :: SQLParameters in ASP.NET C#

clock November 16, 2015 22:10 by author Jervis

SqlParameter represents a parameter to a SqlCommand and optionally its mapping to DataSet columns. Parameter names are not case sensitive. 

To initialize a new instance of SqlParameter class, we can use many constructors such as SqlParameter(), SqlParameter(String, SqlDbType), SqlParameter(String, Object), SqlParameter(String, SqlDbType, Int32), SqlParameter(String, SqlDbType, Int32, String). 

SqlParameter() constructor initialize a new instance of SqlParameter class. Sqlparameter(String, SqlDbType) constructor require parameter name and data type. SqlParameter(String, Object) constructor require parameter name and a value of the new SqlParameter. SqlParameter(String, SqlDbtype, Int32) constructor require parameter name, SqlDbType and size. SqlParameter(String, SqlDbtype, Int32, String) constructor require parameter name , SqlDbType, size and the source column name. 

SqlParameter class have many useful properties such as CompareInfo, DbType, Direction, IsNullable, Offset, ParameterName, Precision, Scale, Size, SourceColumn, SqlDbType, SqlValue, TypeName, Value, XmlSchemaCollectionName etc. 

ParameterName property get or set the SqlParameter name. SqlDbType property get or set the SqlDbType (SQL Server specific data type) for the parameter. SqlDbType enumeration values are BigInt, Binary, Bit, Char, Date, DateTime, Decimal, Float, Image, Int, Money, Real, Text, Time, Timestamp etc. SqlParameter Size property get or set the maximum size in bytes of the data within the column. Direction property get or set a value that indicate whether the parameter is input only, output only, bidirectional or a stored procedure return value parameter. Value property get or set the value of parameter. 

The following c# example source code describe you more about SqlParameter in ASP.NET. 

Create a web form name SqlParameterExample.aspx. Now add a GridView control. We populate the GridView control with SqlDataSource Data. But here we filter the data by SqlParameter. In this example we select the NorthWind database Products table data and filter it with SqlParameter product name. The source code of SqlParameterExample.aspx is here.

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Configuration" %>

<!DOCTYPE html>

<script runat="server">
    protected void Page_Load(object sender, System.EventArgs e) {
        if (!Page.IsPostBack) {
            SqlConnection MyConnection;
            SqlCommand MyCommand;
            SqlDataReader MyReader;
            SqlParameter ProductNameParam;

            MyConnection = new SqlConnection();
            MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings["AppConnectionString1"].ConnectionString;

            MyCommand = new SqlCommand();
            MyCommand.CommandText = "SELECT * FROM PRODUCTS WHERE PRODUCTNAME = @PRODUCTNAME";
            MyCommand.CommandType = CommandType.Text;
            MyCommand.Connection = MyConnection;

            ProductNameParam = new SqlParameter();
            ProductNameParam.ParameterName = "@PRODUCTNAME";
            ProductNameParam.SqlDbType = SqlDbType.VarChar;
            ProductNameParam.Size = 25;
            ProductNameParam.Direction = ParameterDirection.Input;
            ProductNameParam.Value = "CHAI";

            MyCommand.Parameters.Add(ProductNameParam);

            MyCommand.Connection.Open();
            MyReader = MyCommand.ExecuteReader(CommandBehavior.CloseConnection);

            GridView1.DataSource = MyReader;
            GridView1.DataBind();

            MyCommand.Dispose();
            MyConnection.Dispose();
        }
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>SqlParameter example: how to use SqlParameter in asp.net</title>
</head>
<body>
   
<form id="form1" runat="server">
   
<div>
       
<asp:GridView ID="GridView1" runat="server">
       
</asp:GridView>
   
</div>
   
</form>
</body>
</html>

 



ASPHostPortal.com Proudly Announces DNS Failover Service

clock November 10, 2015 22:06 by author Dan

ASPHostPortal.com is an expert web hosting organization that has been around given that 2008. As stated in their mission, their objective would be to offer quality internet hosting solutions with constant innovation and service upgrades at no extra cost to all customers. We build our servers, have our own nationwide fiber network and our own information center. Our hopes are that with our technologies, fantastic people and very first rate facilities we are going to be able to help our buyers attain wonderful success with their websites. Now, we support DNS Failover Service with premium server, high speed connection, and cheap price.

The issue of DNS uptime is often a topic that is ignored until something happens to your website. When you set up your website, you are likely focused on the look of the site and the site's content and SEO rankings. Downtime, however, is an issue that you should also take into consideration before the inevitable happens. You need to ask yourself what you can do to ensure that your site experiences minimal website downtime. You need to ask yourself whether or not your site is capable of handling surges in traffic. You need to consider how you will handle downtime due to things such as configuration errors or even natural disasters.

What you'll do if your website does go down? What will happen if your site monitor's contacts you at two in the morning, alerting you of a site outage? Notification of such an outage will do you no good if you don't have failover support in place. With the right failover support in place, your website traffic can be diverted to another IP address. When your site is back up and running, your site will be diverted back to your primary host. By ensuring proper failover support, you ensure that your customers (and your profits) aren't affected when your primary host goes down.

Aside from world class technologies, the hosting capabilities included are endless. From databases to internet site scripts, e-commerce and multimedia, ASPHostPortal.com provides a significant array of capabilities. ASPHostPortal.com can handle downtime problems with our DNS Failover services. You will not lose your customers and exactly your money. To learn more about our DNS Failover Service, please visit http://asphostportal.com/Windows-Hosting-DNS-Failover-Multiple-Data-Center

About ASPHostPortal.com :
ASPHostPortal.com is The Best, Cheap and Recommended ASP.NET & Linux Hosting. ASPHostPortal.com has ability to support the latest Microsoft, ASP.NET, and Linux technology, such as: such as: WebMatrix, Web Deploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Light Switch, Latest MySql version, Latest PHPMyAdmin, Support PHP 5. x, etc. Their service include shared hosting, reseller hosting, and Sharepoint hosting, with speciality in ASP.NET, SQL Server, and Linux solutions. Protection, trustworthiness, and performance are at the core of hosting operations to make certain every website and software hosted is so secured and performs at the best possible level.



ASP.NET 4.6 Hosting - ASPHostPortal :: How to Upgrade to ASP.NET 4.6 Projects?

clock November 9, 2015 21:59 by author Jervis

The updates in the .NET Framework provide many improvements, including support for new language features in c#, garbage collection, enhancements in cryptography support, feature toggles, new classes in the BCL and others. The RyuJIT compiler adds significant performance gains for 64bit applications, even those not originally targeting the 4.6, improves startup times and can reduce the memory footprint of your application.

While the explicit modification of your projects may not be required to gain some of the 4.6 benefits, there may be other organizational factors that lead you down that path. We’ll work through the mechanics of the upgrade to 4.6 in this post.

Upgrading Your ASP.NET Projects

Every project we create references a specific version of the .NET Framework. This has been true throughout the history of .NET, and though the way we will do it in the future will change with the new project system, the premise remains the same.

For now, you can simply open the properties tab for your project and change the target Framework.

You will be prompted to let you know that some changes may be required.

Now, if you were to try to build the Bootcamp project when you’re only partway through the upgrade, you’d see something similar to the following:

With a message that reads:

“The primary reference “x” could not be resolved because it was built against the “.NETFramework,Version=v4.6” framework. The is a higher version than the currently targeted framework “.NETFramework,Version=4.5.1”.”

You may run into this in other scenarios, as well, especially if you you have references to packages or libraries that get out of sync in your upgrade process. A project that takes on dependencies must be at (or higher than) the target framework of the compiled dependencies. To remedy this, we simply need to complete the upgrade process on the rest of the projects.

Why Upgrade?

Moving from 4.5.x to 4.6 is not a required step in our conversion to an MVC 6 project. In fact, MVC 6 indeed runs on a different framework altogether. To that end, any environment where you have 4.6 installed will “pull up” other assemblies because it is a drop-in replacement for pervious versions.

Perhaps your primary motivator to move to 4.6 is the perf bump in the runtime, or it might be the new language features (which only require a framework install, not a version bump in your target). But it also ensures we’re compatible with other projects in our organization, particularly when we consider the default target for new projects in VS 2015 is against 4.6. If we want to leverage these from other projects in our organization, we want to make sure that we’re not the lowest common denominator in the mix.



ASPHostPortal.com Proudly Announces DotNetNuke 7.4.2 Hosting

clock November 3, 2015 21:23 by author Dan

ASPHostPortal.com is considered one of the best among the many web hosts and is very well-known for reliable servers and most of all exceptional customer service. It relies on the customer satisfaction and hence we offer great prices as well as quality service and most of all the reliability that customers expect in a web hosting site. To keep updated our customer’s website, today we launch DotNetNuke 7.4.2 with cheap price, best support, and high speed connection.

DotNetNuke is the undisputed leader when it comes to Web Content Management for Microsoft ASP.NET. More than 700,000 production websites worldwide use this path breaking technology to manage their websites. DotNetNuke open source Content Management Platform functions as a web application development framework also. This application offers something for everyone so on the basis of your role in the organization you can utilize its powerful utilities to achieve your web initiatives.

DotNetNuke is a brilliant combination of Content management System (CMS) and Web application development framework. This adaptable architecture allows developers to effortlessly add functionality or make changes in the look of the website through the addition of DotNetNuke applications. There are lots of websites where you can find free applications, you can use or customize these applications according to your need. That is reason DotNetNuke has become the first choice of developers.

As one of the most popular and fastest growing hosts, ASPHostPortal.com has exceptional reliability. We have a world class data center that provides top of the industry uptime and multiple functional administrative tools. We offer a top notch and reliable customer service team. Given that Customer Service can be a key differentiator when comparing web hosts, our expert support team always carefully scrutinizes this element. To learn more about our DotNetNuke 7.4.2 Hosting, please visit http://asphostportal.com/Dotnetnuke-7-4-2-Hosting

About ASPHostPortal.com :
ASPHostPortal.com is The Best, Cheap and Recommended ASP.NET & Linux Hosting. ASPHostPortal.com has ability to support the latest Microsoft, ASP.NET, and Linux technology, such as: such as: WebMatrix, Web Deploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Light Switch, Latest MySql version, Latest PHPMyAdmin, Support PHP 5. x, etc. Their service include shared hosting, reseller hosting, and Sharepoint hosting, with speciality in ASP.NET, SQL Server, and Linux solutions. Protection, trustworthiness, and performance are at the core of hosting operations to make certain every website and software hosted is so secured and performs at the best possible level.



Cheap ASP.NET 4.5 Hosting

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

Tag cloud

Sign in