我想使用我在数据集中添加的查询来填充组合框?查询应根据先前的组合框选择提供输出。有关如何对其进行编码的任何帮助
这是我到目前为止的代码,但它不想工作
好的,所以我更新了我的代码,但现在它给了我整个表格的输入,但我希望它被我在 cmbSchool 中选择的任何选项过滤。我现在如何使用参数过滤它?
这是我的新代码
private void cmbSchool_SelectedIndexChanged(object sender, EventArgs e)
{
int ischoolid = Convert.ToInt16(cmbSchool.SelectedValue);
try
{
cmbClassRoomName.DataSource = this.geared4MathDataSet.ClassRoom;
cmbClassRoomName.ValueMember = "ClassRoomID";
cmbClassRoomName.DisplayMember = "ClassRoomName";
//this.classRoomTableAdapter.FillBySchool(this.geared4MathDataSet.ClassRoom, ischoolid);
lblClassroomName.Visible = true;
cmbClassRoomName.Visible = true;
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}