programming we consider all important topic for knowledge about controls,web Services, JSON, Ajax, database, and interview related Question. In this and sql server tutorial blog we give many examples of jquery as like How Play YouTube Video in Your Website by URL, How to Play YouTube Videos in by using Jquery , Jquery Change div background on mouseover in , JQuery UI Datepicker (Calendar) etc.

Friday, August 29, 2014

How to create Temporary Table in ASP.Net using C#

How to create Temporary Table in ASP.Net using C#:

In this post we create a table by programmatically by C# code. Take grid control and bind dynamically created table in this gridviewcontrol.

Create Temporary Table by C#:

<%@ Page Language="C#" AutoEventWireup="true"
Inherits="tablebyCsharp" %>

Transitional//EN" "
<html xmlns="">

    <title>create Temporary Table in ASP.Net using C#</title>
    <form id="form1" runat="server">
    <div align="center">
            Temp data table in using c#</h1>
        <br />
        <%--bind this control by dymanic created table.--%>
        <asp:GridView ID="gird1" runat="server" >
            <HeaderStyle BackColor="Maroon" Font-Bold="true" ForeColor="White" />

Temporary Table in ASP.Net using C# code :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class tablebyCsharp : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
    public void createtable()
        DataTable dt = new DataTable();
        dt.Columns.Add("Cost_Id", typeof(Int32));
        dt.Columns.Add("Name", typeof(string));
        dt.Columns.Add("Address", typeof(string));
        dt.Rows.Add(1, "Parijat", "India");
        dt.Rows.Add(2, "Roz", "U.S.A");
        dt.Rows.Add(3, "Maqsood", "U.P.");
        dt.Rows.Add(4, "Parvez", "Pakistan");
        dt.Rows.Add(6, "Tinny", "Japan");
        dt.Rows.Add(7, "Mr. Song", "Chine");
        gird1.DataSource = dt;
How to create Temporary Table in ASP.Net using C#

Other related Post:

No comments:

Post a Comment