#region 向comboBox控件传递数据表中的数据
/// <summary>
/// 动态向comboBox控件的下拉列表添加数据.
/// </summary>
/// <param name="cobox">comboBox控件</param>
/// <param name="TableName">数据表名称</param>
public void CoPassData(ComboBox cobox, string TableName)
{
cobox.Items.Clear();
DataClass.MyMeans MyDataClsaa = new PWMS.DataClass.MyMeans();
SqlDataReader MyDR = MyDataClsaa.getcom("select * from " + TableName);
if (MyDR.HasRows)
{
while (MyDR.Read())
{
if (MyDR[1].ToString() != "" && MyDR[1].ToString()!=null)
cobox.Items.Add(MyDR[1].ToString());
}
}
}
#endregion
/// <summary>
/// 动态向comboBox控件的下拉列表添加数据.
/// </summary>
/// <param name="cobox">comboBox控件</param>
/// <param name="TableName">数据表名称</param>
public void CoPassData(ComboBox cobox, string TableName)
{
cobox.Items.Clear();
DataClass.MyMeans MyDataClsaa = new PWMS.DataClass.MyMeans();
SqlDataReader MyDR = MyDataClsaa.getcom("select * from " + TableName);
if (MyDR.HasRows)
{
while (MyDR.Read())
{
if (MyDR[1].ToString() != "" && MyDR[1].ToString()!=null)
cobox.Items.Add(MyDR[1].ToString());
}
}
}
#endregion