Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 如何在 Windows 应用程序中将数据集绑定到 DataGridView
如何将数据集绑定到数据网格视图?并且数据集上已经有数据行。我只想将它绑定到数据网格。
我不得不说这几乎是一个重复的问题,这就是答案。
例如:
DataGridView1.AutoGenerateColumns = True; DataGridView1.DataSource = ds; // dataset DataGridView1.DataMember = "TableName"; // table name you need to show