帮我看看以下的语句, OleDbDataAdapter adpt = new OleDbDataAdapter("select * from z2003", conn); DataTable ad = new DataTable(); adpt.Fill(ad); dataGridView1.DataSource = ad; if (dataGridView1.CurrentRow != null) { ((DataRowView)dataGridView1.CurrentRow.DataBoundItem).Delete(); } dataGridView1中怎么不显示"select * from z2003"内容
if (dataGridView1.CurrentRow != null) { ((DataRowView)dataGridView1.CurrentRow.DataBoundItem).Delete(); } 先把这一句屏蔽掉吧
OleDbDataAdapter adpt = new OleDbDataAdapter("select * from z2003", conn);
DataTable ad = new DataTable();
adpt.Fill(ad);
dataGridView1.DataSource = ad; if (dataGridView1.CurrentRow != null)
{
((DataRowView)dataGridView1.CurrentRow.DataBoundItem).Delete();
}
dataGridView1中怎么不显示"select * from z2003"内容
{
((DataRowView)dataGridView1.CurrentRow.DataBoundItem).Delete();}
先把这一句屏蔽掉吧
textBox1.Text=ad.TableName.ToString();
怎么显示不出来东西呢?
如果你已经知道this.dataGridView1.DataSource的类型(比方说是DataTable)可以通过类型转换来实现DataTable dt = this.dataGridView1.DataSource as DataTable;
dt.TableName就知道了;