本文介绍了如何从现有表将数据填充到临时表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我已经通过编程创建了一个临时表.我想将该临时表的数据显示在asp.net的网格视图中.我希望这个临时表将显示现有表的数据中的数据.如何填充前端现有表中的临时表.

临时表的编码是:---

Hello All,
I have created a temporary table through programming.I want to show data of this temporary table into grid view in asp.net.I want that this temporary table will show data from existing table''s data.how it will be possible to fill temporary table from existing table in front end.

coding for Temporary table is:---

private DataTable CreateDataTable()
    {
        DataTable myDataTable = new DataTable();

        DataColumn myDataColumn;

        myDataColumn = new DataColumn();
        myDataColumn.DataType = Type.GetType("System.Int32");
        myDataColumn.ColumnName = "id";
        myDataTable.Columns.Add(myDataColumn);

        myDataColumn = new DataColumn();
        myDataColumn.DataType = Type.GetType("System.String");
        myDataColumn.ColumnName = "Req_Name";
        myDataTable.Columns.Add(myDataColumn);

        myDataColumn = new DataColumn();
        myDataColumn.DataType = Type.GetType("System.Int32");
        myDataColumn.ColumnName = "Req_Amt";
        myDataTable.Columns.Add(myDataColumn);

        myDataColumn = new DataColumn();
        myDataColumn.DataType = Type.GetType("System.DateTime");
        myDataColumn.ColumnName = "Req_date";
        myDataTable.Columns.Add(myDataColumn);

          myDataColumn = new DataColumn();
          myDataColumn.DataType = Type.GetType("System.Int32");
        myDataColumn.ColumnName = "Req_head_ID";
        myDataTable.Columns.Add(myDataColumn);

          myDataColumn = new DataColumn();
          myDataColumn.DataType = Type.GetType("System.Int32");
        myDataColumn.ColumnName = "Req_lib_head_id";
        myDataTable.Columns.Add(myDataColumn);

          myDataColumn = new DataColumn();
        myDataColumn.DataType = Type.GetType("System.String");
        myDataColumn.ColumnName = "req_quantity";
        myDataTable.Columns.Add(myDataColumn);
         

        return myDataTable;
    }

推荐答案


这篇关于如何从现有表将数据填充到临时表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 10:08