34,575
社区成员
发帖
与我相关
我的任务
分享
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 WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
//创建 DataTable , 并加入一行数据
DataTable dt = new DataTable();
dt.Columns.Add("id");
DataRow dr = dt.NewRow();
dr["id"] = 12;
dt.Rows.Add(dr);
this.textBox1.DataBindings.Add("text", dt, "id");
}
}
}