请教C# Navigator问题
private void bindingNavigatorMoveNextItem_Click(object sender, EventArgs e)
{
string ssql = "select * from Student";
SqlDataAdapter ad = new SqlDataAdapter(ssql, "Data Source=陆帆;Initial Catalog=Student;Integrated Security=True");
ds.Clear();
ad.Fill(ds, "Student");
bs.DataSource = ds;
bindingNavigator1.BindingSource = bs;
dataGridView1.DataSource = bs;
}
这段代码有什么问题么?为什么Navigator控件显示灰色呢?
[解决办法]
bs.DataSource = ds;
--bs没有看到申明出来?
bindingNavigator1.BindingSource = bs;
dataGridView1.DataSource = bs;
---dataGridView1.DataSource的datasource通常为数据集,bs不知道是什么?
以上属性都对了,再dataGridView1.databind()