-->

Wednesday, December 4, 2013

Webpage design using Themes in ASP.NET : Skin with CSS File

Applying built-in themes for Webpage design is quite easy, as you just need to specify the name of the theme with the theme attribute of the Page directive. However, you can also apply custom themes to Web pages. For this, you need to create a theme first. To demonstrate how to create themes. Let's create a Web Application Custom theme.

First we need to add the App_Theme folder to our application and perform the following steps for it:

1. Right click on website name in the Solution Explorer window and select Add ASP.NET Folder->Theme from the shortcut menu to add the App_Theme folder. A subfolder named Theme1 is automatically created inside the App_Themes folder.

2. Right-click the Theme1 folder and select the Add New Item option from the context menu to display the Add new Item dialog box.

3. Select the Skin file template option and specify the name of skin as red.skin, and click on Add button. The red.skin file is added to the Theme1 folder in the solution explorer window.

4. After creating a new skin file, add the below code to the red.skin file to define its style properties.

<asp:Button runat="server" BackColor="#336699" ForeColor="White" 
            Height="36px" Width="109px" />
        
        <asp:Label  runat="server" BackColor="#336699" ForeColor="White" 
            Height="50px" Width="199px"></asp:Label>
      
        <asp:TextBox  runat="server" BorderColor="#336699" 
            BorderStyle="Solid" BorderWidth="2px" Height="33px" Width="196px"></asp:TextBox>

In the preceding code, we have defined style properties for three controls, a Label, a Button, and a TextBox.



5. Now to test the skin, add a Label control, a Button control, and a TextBox control in the Default.aspx page as added by the following code.

<%@ Page Language="C#" Theme ="Theme1" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        
    
    </div>
    <asp:Button ID="Button1" runat="server" Height="49px" Text="Button" 
        Width="132px" />
    <br />
    <br />
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    <br />
    <br />
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <br />
    </form>
</body>
</html>

After writing this code, Run default.aspx page and it will show the controls according to style added in skin file.
If you want to implement SkinId in your skin file , this video cover skinId property



Tuesday, December 3, 2013

SQL Server Components with Details: Introduction to SQL Server

SQL Server contains a number of components, provides specific services and support to the clients connected to the server. The following figure depicts the components of SQL Server

SQL Server Components with Details: Introduction to SQL Server

As shown in the preceding figure, SQL Server consists of the following core components, described in this article:

  • Database Engine
  • Integration Services
  • Analysis Services
  • Reporting Services

Database Engine

It provides support to store, query, process, and secure data on the database server. The database engine contains databases and database objects, such as tables and procedures. This database engine allows you to create and manage database objects.

Services provided by database engine:

  • Service Broker: Provides support for asynchronous communication between clients and the database server, enabling reliable query processing. The client application sends a request to the database server and continues to work. The requests sent by the client are queued up at the server, in case the server is not available to process the request immediately. Server Broker ensures that the request is processed whenever the server is available.
  • Replication: Allows you to copy and distribute data and database objects from one database server to another. After replicating data, the SQL Server allows you to synchronize different databases to maintain data located at different locations around the world. All the servers store common data.
  • Full-text search: To implement fast and intelligent search in large database by allowing you to search records containing certain words and phrases. You can search for different forms of a specific word, such as ‘produce’, ‘produces’, or ‘production’. In addition, you can search for synonyms of a given word, such as ‘garment’, ‘cloth’, or ‘fabric’.
  • Notification services: Allows you to generate and send notification messages to the users or administrators about any event. For example, the database administrator should be notified when a database object is created or deleted. The notification messages can be sent to a variety of devices, such as computers of mobile devices.

Integration Services

Integration services allow you to gather and integrate data from various disparate data sources available in an organization. You can store the data in a consistent format in a common database called the data warehouse.
For example, data in your organization might be stored in different databases, such as Microsoft Access, FoxPro, or text files. You might need to consolidate data from all these sources and save the data in a common set tables on a database server.

The integration services provide a set of tasks that help the developer create data integration projects with minimum lines of code. Data integration allows collation of data from all the data sources in a common format to enable accurate analysis of data.

Analysis Services

Analysis services help in data analysis in a BI application. These applications are built on a data warehouse that contains data consolidated from various data sources. These services provide data mining solutions that are built on data integrated in the data warehouse. Data mining solutions allow the users to query and present data in reports that enable business forecasts, such as expected sales or profit estimates in the next financial year.

Reporting Services

Reporting services provide support to generate comprehensive reports on data in the database engine or in the data warehouse. These services provide a set of tools that help in creating and managing different types of reports in different formats. Using these services, you can create centralized reports that can be saved to a common server and provide secure and restricted access to these reports.


Multi-Tier Architecture & Its Layers: Introduction to SQL

In this architecture of SQL server, it is possible to keep the UI-centric processing on a computer, near the client. In addition, database developer may keep the data-centric processing components on another computer near the database server, so that you get significant performance benefits.

Three-tier architecture is used till the manageable size of business tier. As the business complexities increases, the business tier became larger and unmanageable. This led to the evolution of N-tier architecture, where the business services model was divided into smaller manageable units. N-tier architecture is also called as multi-tier architecture.

The N-tier architecture consists of the following layers:

  • Client tier
  • UI-centric processing components
  • Data-centric processing objects
  • Database server

A banking application, when further expanded, can depict an example of n-tier architecture. The client tier would deal with the user interface, which would include the user interface controls, such as forms, menus, and toolbars. The server tier would comprise data-handling including saving data to the database server.

The business logic would include the rules and guidelines for different types of accounts, Interest rates, fixed deposits, ATMs, and overdrafts. All these would form the middle tier. However, there would be some rules that need to be implemented on the user interface and on the database. You can place these rules either on the UI-centric processing components of data-centric processing components, based on the functionality.

Applications that follow multi-tier architecture can be used across various locations. For Example, in Web applications, the application is stored on the Web server. The clients access the application from any location through a browser software. The clients make requests and receive response from the Web server.


The Web server transfers the request for data to a database server, as shown in the following figure.


Multi-Tier Architecture & Its Layers: Introduction to SQL

In above diagram, all the computers are web clients, remains are specified. Depending on the relevance of the business rules, they can be implemented on any of the tiers, such as the Web clients, Web server, or the database server.

To provide support to applications where users can send requests simultaneously, the database server needs to be a fast, reliable, and secure. SQL Server 2005 is one such comprehensive database platform that provides a fast, reliable, and secure RDBMS. It also helps in data analysis with integrated tools.

Here BI application is an application that is used by the top management of an organization for data analysis to make future decisions. BI tools are the tools that help in creating reports that enable data analysis.

Database Architectures used by Database Developer: Introduction to SQL

According to earlier discussion about employee’s details storage in database, any business application can have some major elements as Single-tier Architecture, Two-tier architecture, Three-tier Architecture and at the last N-tier Architecture in context of SQL server. A database developer can easily use this concepts in sql by following below description.

Single-Tier Architecture

In single-tier architecture, all elements of a business application are combined as a single executable unit. This unit is installed on all the computers that the users need to work on. It is required to recompile and redistribute the entire application to all the computers, after any modification. That’s why it becomes complicated to modify the application or to fix any bugs.

Two-Tier Architecture

This architecture makes entry to address the problems in modifying an application faced in a first scenario. In two-tier architecture, the application is divided into two manageable parts; one part handles the data, while the other provides the user interface. The two parts can be located on a single computer or on separate computers over a network.

The part that handles the user interface (UI) is called the client tier. The part that Implements the application logic and manages the input data based on the business rules is called the server tier, as shown in the following connection.

Client Computers<---------------------------------->Database Server

Two-tier architecture is also called client-server architecture. Most RDBMSs, such as Microsoft Access, SQL Server, and Oracle adhere to the client-server architecture. RDBMS provides centralized functionality required while supporting many users.

Three-Tier Architecture

When implementing complex business solutions in case of a two-tier architecture, the tier on which the business logic is implemented becomes over loaded. As a result, it takes more time to execute. Therefore, to provide further flexibility, the two-tier architecture can be split into three tiers. In three-tier architecture, the first tier is the client tier, the second or middle tier is called the business tier and the third tier is called the server tier. The server tier contains a database server that manages the data.

Client Computers<-------->Business Tier <-------->Database Server

The business tier consists of all the business rules. It consists of the application logic that Implements rules and checks the data. The advantage of a three-tier application is that it allows you to change the business rules without affecting the other two tiers.

For instance in a banking application for loans, the user tier is the front-end, used by the customer to specify the loan details. The server tier can consist of an RDBMS in which the data is stored. The business tier lies between the other two tiers and consists of business rules, such as the loan limit and the interest rate charged to a customer. If there is a change in the rate of interest, only the middle tier component needs to be modified.

N-Tier Architecture

Webpage design using master page and css in asp.net

Webpage design is term to represent proper arrangement of the objects. If you want to design webpages in asp.net using master page, you should use visual studio IDE (Integrated Development Environment).
Lets take a simple steps for webpage design using master page and CSS.
Step-1 : Open visual studio , i have visual studio 2010 IDE
Step-2 :  Select new website under file menu.
Step-3 :  In the left pane select visual c# also select ASP.NET Empty website in the middle pane in New website window.
Step-4 : Open Add new item window using Ctrl+Shift+A and select master page. Also select "place code in separate file" check box
Step-5 : Here, simple demonstration of master page.

webpage design : master page source code

Step-6: Before further designing take a rough diagram of your webpage, suppose your page look like.
Rough diagram of webpage design


Step-7 : Now, we will start designing in master page. First we take HTML table just after <form> tag, Bydefault table contains three rows and three columns.
Step-8 : Select all cell of the first row for designing Header part, merge all of them by selecting "MergeCells" in modify menu.
modify cell of the html table in webpage design


Step-9 : Similarly again Merge cell for designing sidebar,content, and footer part.
Step-10 : Place ContentPlaceHolder in content part. Now your master page look like.

webpage design of master page in asp.net


Step-11 : Add new Item using Ctrl+Shift+A , select webform which extension as .aspx. Also this page inherits from master page so select master page check Box and press add button.
Step-12 : Now you can see your default.aspx page inherits layout of the master page.

Monday, December 2, 2013

Data Engine for Database Developer: Introduction to SQL

SQL Server, a data engine introduced by Microsoft, lies at the core of data Management solution of an organization. It allows secure, efficient storage and Management of data. SQL database Server also provides other components and Services that support the business intelligence platform to generate reports and facilitate Data analysis used by database developer.

Every organization needs to maintain information related to employees, Customers or Business partners. Organizations build business applications either to store and manipulate the information or to generate reports. In addition, they need a platform that can be used to store and maintain these information in an efficient way. Various database management systems (DBMS) and relational database Management system (RDBMS) such as SQL Server 2005, Oracle and Sybase can be used to maintain this information.
How to install SQL Server
It is important for a database developer to identify the role of a database server in an organization, to effectively design and implement database solutions by using SQL Server, to identify its components and services. In Addition, you need to understand the basics of SQL, a language that is used to query and manage data.

Role of a Database Server

Earlier, organizations used to store the data on paper. With an increase in the usage of computers, they began building and using business applications to support the business operations.

The business applications accept data/information as input, process the data based on business requirements and provide data/information as output. For example, an application that maintains the sales details for an organization, accepts the details of the sales transaction from the users. The data is saved and an output message will display confirming that the data has been saved.

For example, the Human Resource department of an organization uses an application to manage employee’s data. The users need to add the details of new employees. The application provides an interface to enter the employee details. These details are validated for accuracy based on business rules. A business rule is defined to check that the date of joining of the new employee is less than or equal to the current date. If the data meets the requirements, it is saved in the data store.

Architectures used in Business application

Friday, November 29, 2013

Windows 8 App Development: How to use HyperlinkButton in c# code file

In my previous article, i have discuss hyperlinkbutton with XAML code in windows 8 app development. In this article i will explain use this button in c# code file. Write the below code in specified file:

XAML CODE

<Page
    x:Class="App4.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App4"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
     
<HyperlinkButton x:Name="h1" Height="200" Width="257" Content="Microsoft Development Network" Margin="90,20,0,548" Click="h1_Click" />
    </Grid>
</Page>

CODE FILE
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
using Windows.UI.Xaml.Navigation;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace App4
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
            //BitmapImage img = new BitmapImage();
            //img.UriSource = new Uri(this.BaseUri,"Image/youtube.png");

            //Image1.Source = img;
            List<string> lit = new List<string>();
            lit.Add("Apple");
            lit.Add("Apple");
            lit.Add("Apple");
            lit.Add("Apple");
            //l1.ItemsSource = lit;           
        }

        private void h1_Click(object sender, RoutedEventArgs e)
        {
            Uri uri = new Uri("http://www.msdn.microsoft.com");
            h1.NavigateUri = uri;            
        }    
    }
}
In the above c# code, look out the click event of hyperlinkbutton h1, i have created an object of Uri class with the link as a constructor's parameter. And then set the property NavigateUri  to the object defined above. When user will click on this button, it will redirect programmer to the specified page.

OUTPUT
Windows 8 App Development: How to use HyperlinkButton in c# code file

Windows 8 App Development: How to use HyperlinkButton in c# code file

First image shown the hyperlinkbutton created by the c# code, when programmer will click on that button, it will redirect on the msdn page, shown in the second image. The second image shows the latest feature in windows 8 app development as it is redirecting programmer and both the pages are side by side.
© Copyright 2013 Computer Programming | All Right Reserved