构造函数问题... [英] constructor issue...
本文介绍了构造函数问题...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不确定如何执行此操作,但是我有一个组合框,将使用以下代码手动弹出该框:
im not sure how to go about this but i have a combobox that i will popupate manually with the following code:
public void GetRows()
{
foreach (DataTable dt in dsLocal.Tables)
{
int i = 0;
foreach (DataRow dr in dt.Rows) //loop through rows
{
comboBoxLocal.Properties.Items.Add(dsLocal.Tables[0].Rows[i][table]);
i++;
}
}
}
我将其放在单独的类中,以便我可以再次调用它来填充其他组合框...
我用以下行来调用该类: ;,0);
每次我想填充组合框时
使用构造函数会有所帮助吗?
我不确定我该怎么做...
i have put this in a separate class so i can call it again to populate other comboboxes...
i call the class with this line:
GetComboBoxRows getRows = new GetComboBoxRows(stockLocationData, comboBoxEditLocation,"Location",0);
everytime i want to populate a combobox
will the use of a constructor help??
im not sure how i must go about it...
推荐答案
请粘贴整个类代码以及实现代码.
请注意,
Jai
Please paste the whole class code as well as the implementation code.
Regards,
Jai
这篇关于构造函数问题...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文