zoukankan      html  css  js  c++  java
  • DataTable Columns

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;

    namespace WindowsFormsTest
    {
        public partial class Form1 : Form
        {
            DataTable dt = new DataTable();
            public Form1()
            {
                InitializeComponent();

                dt.Columns.AddRange(
                     new DataColumn[]
                    {
                        new DataColumn("Id", typeof(int)),
                        new DataColumn("Name", typeof(string))
                    });
                dataGridView1.DataSource = dt;

            }

            private void Form1_Load(object sender, EventArgs e)
            {
                dt.Rows.Add(1, "AAAA");
                dt.Rows.Add(2, "BBBB");
            }
        }
    }

  • 相关阅读:
    linux ipsec
    inotify+rsync
    多实例tomcat
    Http和Nginx反代至Tomcat(LNMT、LAMT)
    cisco ipsec
    ansible基础
    Qt 汉字乱码
    Model/View
    面对焦虑
    QT中QWidget、QDialog及QMainWindow的区别
  • 原文地址:https://www.cnblogs.com/perock/p/2768067.html
Copyright © 2011-2022 走看看