Oct 27, 2015

Posted in , , , ,

MS SQL 2008: How to Find the Nth Maximum and Minimum Value in a Column?

This post will explain about how to find the Nth Maximum and Minimum Value in a Column. There are several methods to find out the Nth maximum/minimum value using SQL. This article discusses on such method to find Nth maximum value from a desired table.

MS SQL 2008: How to Find the Nth Maximum and Minimum Value in a Column?

Now write the following code:
DECLARE @n INT
SET @n=2
SELECT USER_ID,username from
(
 SELECT USER_ID,username,ROW_NUMBER() OVER(ORDER BY USER_ID DESC) AS Higher
 FROM User_Details
) AS Higher
 WHERE Higher=@n

DECLARE @nth INT
SET @nth=2
SELECT USER_ID,username from
(
 SELECT USER_ID,username,ROW_NUMBER() OVER(ORDER BY USER_ID ASC) AS Lower
 FROM User_Details
) AS Lower
 WHERE Lower=@nth

Enter the value at @n what you have to enter then i will display according to @n value. I hope it works for you!

Oct 20, 2015

Posted in , , , ,

How to Produce Text file in ASP.NET 4.6?

In this example we explain that how to produce text file in ASP.NET 4.6 or write data to the text file fetching from the database.

How to Produce Text file in ASP.NET 4.6?


Here usually we create new file and write data to text file from the database.below is code for creating text file and write data to it.

HostForLIFE.eu

fs1 = new FileStream(Server.MapPath("Files\\demo.txt"), FileMode.OpenOrCreate, FileAccess.Write);

writer.Write("Name :" + Convert.ToString(dtDetails.Rows[0]["name"]) + Environment.NewLine);
    writer.Write("City :" + Convert.ToString(dtDetails.Rows[0]["Clty"]) + Environment.NewLine);
    writer.Write("Country" + Convert.ToString(dtDetails.Rows[0]["Country"]) + Environment.NewLine);
writer.Close();

you can also overwrite the existing file if exist like just write
fs1 = new FileStream(Server.MapPath("Files\\demo.txt"), FileMode.Create);

And here is the output:
How to Produce Text file in ASP.NET 4.6?

Oct 16, 2015

Posted in , , ,

HostForLIFE.eu Launches New Data Center in Chennai (India)

HostForLIFE.eu, a leading Windows hosting provider with innovative technology solutions and a dedicated professional services team proudly announces a new Data Center in Chennai (India) for all costumers. HostForLIFE’s new data center in Chennai will address strong demand from customers for excellent data center services in Asia, as data consumption and hosting services experience continued growth in the global IT markets.


The new facility will provide customers and their end users with HostForLIFE.eu services that meet in-country data residency requirements. It will also complement the existing HostForLIFE.eu. The Chennai (India) data center will offer the full range of HostForLIFE.eu web hosting infrastructure services, including bare metal servers, virtual servers, storage and networking.

HostForLIFE.eu expansion into Chennai gives them a stronger European market presence as well as added proximity and access to HostForLIFE.eu growing customer base in region. HostForLIFE.eu has been a leader in the dedicated Windows & ASP.NET Hosting industry for a number of years now and they are looking forward to bringing their level of service and reliability to the Windows market at an affordable price.

The new data center will allow customers to replicate or integrate data between Chennai data centers with high transfer speeds and unmetered bandwidth (at no charge) between facilities. Chennai itself, is a major center of business with a third of the world’s largest companies headquartered there, but it also boasts a large community of emerging technology startups, incubators, and entrepreneurs.

Their network is built from best-in-class networking infrastructure, hardware, and software with exceptional bandwidth and connectivity for the highest speed and reliability. Every upstream network port is multiple 10G and every rack is terminated with two 10G connections to the public Internet and two 10G connections to their private network. Every location is hardened against physical intrusion, and server room access is limited to certified employees.

All of HostForLIFE.eu controls (inside and outside the data center) are vetted by third-party auditors, and they provide detailed reports for their customers own security certifications. The most sensitive financial, healthcare, and government workloads require the unparalleled protection HostForLIFE.eu provides.

Chennai (India) data centre meet the highest levels of building security, including constant security by trained security staff 24x7, electronic access management, proximity access control systems and CCTV. HostForLIFE.eu is monitored 24/7 by 441 cameras onsite. All customers are offered a 24/7 support function and access to their IT equipment at any time 24/7 by 365 days a year.

For more information about new data center in Chennai, please visit http://hostforlife.eu/Chennai-Hosting-Data-Center

About HostForLIFE.eu
HostForLIFE.eu is an European Windows Hosting Provider which focuses on the Windows Platform only. HostForLIFE.eu deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

HostForLIFE.eu is awarded Top No#1 SPOTLIGHT Recommended Hosting Partner by Microsoft (see http://www.asp.net/hosting/hostingprovider/details/953). Their service is ranked the highest top #1 spot in several European countries, such as: Germany, Italy, Netherlands, France, Belgium, United Kingdom, Sweden, Finland, Switzerland and other European countries. Besides this award, they have also won several awards from reputable organizations in the hosting industry and the detail can be found on their official website.

Oct 12, 2015

Posted in , , , ,

Binding the Drop Down List Form Database

In the web development the drop down list is most vital tool, we have a tendency to Use several time and lots of places to use this for showing the list in hidden format. And to fill date in to this list, after we need on page the choose a particular item in this drop down list in to ASP.NET code.Now, I want to fill all class names in to drop down list that are store in the data base. For this a have a table that has classes name.

Binding the Drop Down List Form Database

Next step, create a web page. Take a drop down list in to page. Write the following code
<asp:DropDownList ID="ddlclassId"
runat="server" Width="128px" AutoPostBack="True">                     
</asp:DropDownList>

In below code we will give the drop down list id is "ddlclassId" for understanding to drop down. Then go to the coding page and make a function for selecting the value form data base.
private void FillClass()
{
DataSet ds=new DataSet();
ds=objc1.Select_Class();

/*
in the brown color coded part use for fetching data form table in to Dataset use some class file and Store processor for this .if you have other way then put here.
we select two values Class Name and Section Name in Class and Class Id ,Class id is primary key ..
*/

ddlclassId.DataTextField = "Class";
//dataTextField hold those value which are show in list .
ddlclassId.DataValueField = "ClassId";
//dataValueField use for get unicq value of selected item.
ddlclassId.DataBind();
ddlclassId.Items.Insert(0, new ListItem("Select", "0"));
//this line use for inserting "Select" in to list .
}

Call this function in to page load Event .
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
 
    FillClass();
 
}
}
HostForLIFE.eu
After that, "right click" on the design page and view in browser. I hope it works for you!

Oct 6, 2015

Posted in , , , ,

ASP.NET Hosting - How to Hide jQuery Dialog Modal Popup after AJAX Call Success ?

This post is about How to Hide jQuery Dialog Modal Popup after AJAX Call Success.
ASP.NET Hosting

HTML Markup
The below HTML Markup consists of an HTML DIV containing a TextBox to enter some content, a Button for triggering jQuery AJAX call.
<div id="dialog" style="display: none">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
    <td>
        Name:
    </td>
    <td>
        <input type="text" id="txtName" value="" />
    </td>
</tr>
<tr>
    <td colspan="2" align="center">
        <img id="imgLoader" alt="" src="loading.gif" style="visibility: hidden" />
    </td>
</tr>
<tr>
    <td colspan="2" align="right">
        <input type="button" id="btnSubmit" value="Submit" />
    </td>
</tr>
</table>
</div>

The WebMethod
In order to illustrate the functioning, an ASP.Net WebMethod is used which will accept a string value and will simply return Boolean value True in response. A delay of two seconds has been added to experience the process as otherwise the jQuery UI Modal Popup box will hide instantly.
Note: This solution is not restricted only to ASP.Net and it can be easily used for other technologies too.
[System.Web.Services.WebMethod]
public static bool SubmitDetails(string name)
{
//Fake Delay.
System.Threading.Thread.Sleep(2000);
return true;
}

How to Hide jQuery Dialog Modal Popup after AJAX Call Success ?

Inside the jQuery document ready event handler, the jQuery UI Dialog Modal Popup plugin is applied to the HTML DIV and the jQuery UI Dialog Modal Popup box is shown. When the Button is clicked a jQuery AJAX call is made to the WebMethod and the Loading GIF image is displayed.
Once the response is received then inside the success event handler, the jQuery UI Dialog Modal Popup box is closed (hidden).
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>
<link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/blitzer/jquery-ui.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(function () {
$("#dialog").dialog({
    autoOpen: true,
    modal: true,
    title: "Submit Details"
});
$("#btnSubmit").click(function () {
    $("#imgLoader").css("visibility", "visible");
    $.ajax({
        type: "POST",
        url: "Default.aspx/SubmitDetails",
        data: "{name: '" + $("#txtName").val() + "'}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (r) {
            $("#imgLoader").css("visibility", "hidden");
            $("#dialog").dialog("close");
        }
    });
});
});
</script>



Sep 21, 2015

Posted in , , , ,

Visual Studio Hosting Tips - How to Find PublicKeyToken of a DLL?

In this post, we will learn about how to find PublicKeyToken of a DLL that we add as a reference to our project. Today i used to be trying to see a public key of a DLL that I added to my MVC project. I learned that we can verify this by using our Visual Studio itself. Here i'm sharing that info and will use Visual Studio 2012.
 
Using the code
To determine the DLL information, you need to run your project, since this process will work only in correct mode. you wish to place a breakpoint somewhere in your cs page.

And once the break hits, you wish to go to the immediate window by pressing Alt+Ctrl+I.
Now a window can open, there you need to write the following:
?System.Reflection.Assembly.LoadFile(@"C:\SVenu\TestApp\TestApp\bin\CellSetGrid2.dll").FullName
Then you can see the output in the immediate window as follows:
If you are not in debug mode or you are in design mode, you will get a warning:
“The expression cannot be evaluated while in design mode.”

You can always check the entire details of the DLL by giving the following code:
?System.Reflection.Assembly.LoadFile(@"C:\SVenu\TestApp\TestApp\bin\CellSetGrid2.dll")
Then you can see the output:
Please note that the output given here will be different depending on your DLL.
 
HostForLIFE.eu Visual Studio Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments. 
 
Visual Studio Hosting Tips - How to  Find PublicKeyToken of a DLL?

Mar 9, 2015

Posted in , , ,

HostForLIFE.eu Launches Cheap New Data Center in Frankfurt

HostForLIFE.eu, a leading Windows and ASP.NET hosting provider with innovative technology solutions and a dedicated professional services team proudly announces a new Data Center in Frankfurt (Germany) for all costumers. HostForLIFE’s new data center in Frankfurt will address strong demand from customers for excellent data center services in Europe, as data consumption and hosting services experience continued growth in the global IT markets.


The new facility will provide customers and their end users with HostForLIFE.eu services that meet in-country data residency requirements. It will also complement the existing HostForLIFE.eu. The Frankfurt (Germany) data center will offer the full range of HostForLIFE.eu web hosting infrastructure services, including bare metal servers, virtual servers, storage and networking.

HostForLIFE.eu expansion into Frankfurt gives them a stronger European market presence as well as added proximity and access to HostForLIFE.eu growing customer base in region. HostForLIFE.eu has been a leader in the dedicated Windows & ASP.NET Hosting industry for a number of years now and they are looking forward to bringing their level of service and reliability to the Windows market at an affordable price.


The new data center will allow customers to replicate or integrate data between Frankfurt data centers with high transfer speeds and unmetered bandwidth (at no charge) between facilities. Frankfurt itself, is a major center of business with a third of the world’s largest companies headquartered there, but it also boasts a large community of emerging technology startups, incubators, and entrepreneurs.

Their network is built from best-in-class networking infrastructure, hardware, and software with exceptional bandwidth and connectivity for the highest speed and reliability. Every upstream network port is multiple 10G and every rack is terminated with two 10G connections to the public Internet and two 10G connections to their private network. Every location is hardened against physical intrusion, and server room access is limited to certified employees.

All of HostForLIFE.eu controls (inside and outside the data center) are vetted by third-party auditors, and they provide detailed reports for their customers own security certifications. The most sensitive financial, healthcare, and government workloads require the unparalleled protection HostForLIFE.eu provides.

Frankfurt (Germany) data centres meet the highest levels of building security, including constant security by trained security staff 24x7, electronic access management, proximity access control systems and CCTV. HostForLIFE.eu is monitored 24/7 by 441 cameras onsite. All customers are offered a 24/7 support function and access to their IT equipment at any time 24/7 by 365 days a year.

For more information about new data center in Frankfurt, please visit http://hostforlife.eu/Frankfurt-Hosting-Data-Center

About HostForLIFE.eu
HostForLIFE.eu is an European Windows Hosting Provider which focuses on the Windows Platform only. HostForLIFE.eu deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

HostForLIFE.eu is awarded Top No#1 SPOTLIGHT Recommended Hosting Partner by Microsoft (see http://www.asp.net/hosting/hostingprovider/details/953). Their service is ranked the highest top #1 spot in several European countries, such as: Germany, Italy, Netherlands, France, Belgium, United Kingdom, Sweden, Finland, Switzerland and other European countries. Besides this award, they have also won several awards from reputable organizations in the hosting industry and the detail can be found on their official website.