Wednesday, February 15, 2012

How to create table in SQL Server

Now we are going to create Table for the previous DataBase "myalbum" as menctioned in the previous post
i.e.,  How to create database in sql server
Create a table in sql server as shown below...

The SQL syntax for CREATE TABLE is

How to create DataBase in SQL Server

The following syntax shows how to create database...

Syntax :-
CREATE database DataBaseName

In the below example i am creating a database name as myalbum
Now in SQL Server Management Studio as shown below..

What is Database?

      A database can be thought of as a set of logically related files organized to facilitate access by one or more applications lithographically and to minimize data redundancy. So that it can easily be accessed, managed, and updated. In one view, databases can be classified according to types of content :-
  1. Bibliographic
  2. Full-Text 
  3. Numeric and 
  4. Images.

Thursday, February 2, 2012

dynamic dropdownlist and get selected value on postback in asp net C#

In the previous example i explained how to create DynamicDropDownList in ASP.Net

creating dynamic dropdownlist and applying cssclass in asp net C#

Now i will explain how to create and retrive selected values in postback in this post.
The dropdownlists will create to a panel as shown in the image below.

In the Page_Load write this code

          if (!Page.IsPostBack)
            this.NumberOfControls = 5;
        else
        {
            createDDL();
        }

Wednesday, February 1, 2012

creating dynamic dropdownlist and applying cssclass in asp net C#

Write the following code in the page_Load or page_PreInit or Button_Click events to create dynamic dropdownlist.


    DropDownList ddl = new DropDownList();
    ddl.ID = "ddlOne";
    ddl.Items.Add(new ListItem("Select", ""));
    ddl.Items.Add(new ListItem("One", "1"));
    ddl.Items.Add(new ListItem("Two", "2"));
    ddl.Items.Add(new ListItem("Three", "3"));
    ddl.Items.Add(new ListItem("Four", "4"));
    ddl.Items.Add(new ListItem("Five", "5"));

Custom Paging In GridView without objectDataSource c#

Take a gridview as shown below

<asp:GridView ID="GridView2" runat="server" Width="750" AutoGenerateColumns="false" AllowPaging="true" onpageindexchanging="GridView2_PageIndexChanging" >

After <Columns> </Columns> tag write