private void NameShow()
{
string str = "Select Name from T_RefDr Order By Name";
cbxSupName.DataBindings.Clear();
cbxSupName.DataSource = null;
cbxSupName.Items.Clear();
con = new OleDbConnection(dbCon());
OleDbCommand cmd = new OleDbCommand(str, con);
con.Open();
OleDbDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
if (dr.IsDBNull(0) == false)
{
cbxSupName.Items.Add(dr.GetValue(0).ToString());
}
else
{
cbxSupName.Text = "No Items";
}
}
dr.Close();
con.Close();
cbxSupName.Text = "Select";
}
No comments:
Post a Comment