我正在使用 c# 在 Visual Studio 2013 中编码。我有一个全局字符串变量,它是"order",如下代码所述:Globals.order
private void frmPrint_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'cashierDatabaseDataSet.MALE_LINEUP' table. You can move, or remove it, as needed.
this.mALE_LINEUPTableAdapter.Fill(this.cashierDatabaseDataSet.MALE_LINEUP, Globals.order);
}
现在,我希望mALE_LINEUPTableAdapter
填充仅包含MALE_LINEUP table
上Globals.order
匹配字符串值的cashierDatabaseDataSet
。
我在 MSDN 上发现了一个类似的条件,它指示我像这样编写它:
customersTableAdapter.FillByCity(northwindDataSet.Customers, "Seattle");
但它给了我错误:
"方法'Fill'没有重载需要 2 个参数">
请有人帮我!
您似乎跳过了演练的第一部分,该部分创建了一个采用两个参数的FillByCity
方法。 基本Load
方法只采用一个参数 - 要加载的表。
按照演练中的说明创建类似的FillByOrder
方法,并将参数传递给该方法。