Gridview不显示数据 [英] Gridview Not Displaying Data
问题描述
嗨朋友们,
我在表单上有一个gridview,用于显示连接到访问数据库上的数据的tableadapter的数据。 TableAdapter是一个名为CountraAccount的标准。但是,每当我启动应用程序时,结果都是一个带有空白网格视图的表单?
I have a gridview on the form to display a data as per tableadapter connecting to data on an access database. The TableAdapter is one with a criteria named CountraAccount. However, whenever I launch the application the result is a form with a blank gridview?
如下所示的Form_Load事件呈现一个空白网格视图:
The Form_Load event like the following presents a blank gridview:
private void frmAccDet_Load(object sender, EventArgs e)
{
this.generalLedgerTableAdapter.Fill(this.accountingDataSet.GeneralLedger, this.iDTextBox.Text);
}
同时,如果我插入一个如下所示的硬编码ID(字符串),结果是完美的:
While at the same time, if I insert an ID (a string) hardcoded like the following, the result is perfect:
private void frmAccDet_Load(object sender, EventArgs e)
{
this.generalLedgerTableAdapter.Fill(this.accountingDataSet.GeneralLedger, "010" /*this.iDTextBox.Text*/);
}
可能是什么原因?
推荐答案
我想我找到了它。
I guess I found it.
应该是以下事件:
MyBindingNavigator.PositionItem.TextChanged
MyBindingNavigator.PositionItem.TextChanged
而不是Form_Load事件。
instead of a Form_Load event.
我是对的吗?或者更好的建议?
Am I right? or any better suggestion?
这篇关于Gridview不显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!