private void buildcboAuthors()
{
OleDbCommand cmd = new OleDbCommand("SELECT * FROM tblAuthors",conn);
this.conn .Open ();
OleDbDataReader rsAutors = cmd.ExecuteReader();
ArrayList Authors = new ArrayList();
while(rsAutors.Read())
{
Authors.Add (new AddValue
(rsAutors.GetString(1),rsAutors.GetInt32 (0)));
}
rsAutors.Close();
this.conn.Close();
this.cboAuthors.DataSource = Authors;
this.cboAuthors .DisplayMember ="Display";
this.cboAuthors.ValueMember = "Value";
AuthorsHaveBeenAdded=true;
}
No comments:
Post a Comment