私はこの問題を解くのに苦労しています。の上に"---OTHERS---"
のテキストを追加したいのですが、私のComboBox
にはMySQLは:あなたがWinform
を使用しているようmysqlが埋め込まれたコンボボックスの上に "---その他"を追加
conDatabase = new MySqlConnection(constring);
MySqlCommand cmdDatabase = new MySqlCommand("select distinct item_type from Company_db.inventory", conDatabase);
try
{
MySqlDataAdapter sda = new MySqlDataAdapter();
sda.SelectCommand = cmdDatabase;
DataSet dbdataset = new DataSet();
sda.Fill(dbdataset);
cbPart.DataSource = dbdataset.Tables[0];
cbPart.DisplayMember = "item_type";
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
これは今動作します!解決策を投稿する – DOODpls