zoukankan      html  css  js  c++  java
  • c#创建Table

    private void BindDatazhangting()
    {
    DataTable dt = new DataTable();
    dt.Columns.Add("channel", Type.GetType("System.String"));
    dt.Columns.Add("target", Type.GetType("System.Int32"));
    dt.Columns.Add("this_order", Type.GetType("System.Int32"));
    dt.Columns.Add("last_order", Type.GetType("System.Int32"));
    dt.Columns.Add("ratio", Type.GetType("System.Int32"));
    dt.Columns.Add("complete", Type.GetType("System.Int32"));
    dt.Rows.Add();
    DataRow dr = dt.NewRow();
    dr["channel"] = "短信";
    dr["target"] = 1233;
    dr["this_order"] = 1233;
    dr["last_order"] = 1233;
    dr["ratio"] = 1233;
    dr["complete"] = 1233;
    dt.Rows.Add(dr);
    dr = dt.NewRow();
    dr["channel"] = "短信";
    dr["target"] = 1233;
    dr["this_order"] = 1233;
    dr["last_order"] = 1233;
    dr["ratio"] = 1233;
    dr["complete"] = 1233;
    dt.Rows.Add(dr);

    dr = dt.NewRow();   //插入数据
    dr["channel"] = "短信";
    dr["target"] = 1233;
    dr["this_order"] = 1233;
    dr["last_order"] = 1233;
    dr["ratio"] = 1233;
    dr["complete"] = 1233;
    dt.Rows.Add(dr);
    dr = dt.NewRow();
    dr["channel"] = "短信";
    dr["target"] = 1233;
    dr["this_order"] = 1233;
    dr["last_order"] = 1233;
    dr["ratio"] = 1233;
    dr["complete"] = 1233;
    dt.Rows.Add(dr);


    //dlzhangting.DataSource = dt;//绑定datalist
    //dlzhangting.DataBind();
    }

  • 相关阅读:
    C
    O
    扩展KMP
    扩欧与乘法逆元
    E
    D
    [LeetCode] Same Tree 深度搜索
    [LeetCode] Remove Duplicates from Sorted List 链表
    [LeetCode] Balanced Binary Tree 深度搜索
    [LeetCode] Remove Nth Node From End of List 快慢指针
  • 原文地址:https://www.cnblogs.com/lacey/p/5242011.html
Copyright © 2011-2022 走看看