دوستان کسی می دونه چه طوری می شود با کد نویسی اطلاعات از ACCESS را در combobox نمایش داد .
Printable View
دوستان کسی می دونه چه طوری می شود با کد نویسی اطلاعات از ACCESS را در combobox نمایش داد .
سلام دوستان من خودم اینو نوشتم شاید بدردتون بخوره.
private void combo()
{
comboBox1.Items.Add(dataGridView2.CurrentRow.Cells[1].Value.ToString());
comboBox1.Items.Add(dataGridView2.CurrentRow.Cells[2].Value.ToString());
comboBox1.Items.Add(dataGridView2.CurrentRow.Cells[3].Value.ToString());
comboBox1.Items.Add(dataGridView2.CurrentRow.Cells[4].Value.ToString());
comboBox1.Items.Add(dataGridView2.CurrentRow.Cells[5].Value.ToString());
comboBox1.Items.Add(dataGridView2.CurrentRow.Cells[6].Value.ToString());
comboBox1.Items.Add(dataGridView2.CurrentRow.Cells[7].Value.ToString());
comboBox1.Items.Add(dataGridView2.CurrentRow.Cells[8].Value.ToString());
comboBox1.Items.Add(dataGridView2.CurrentRow.Cells[9].Value.ToString());
comboBox1.Items.Add(dataGridView2.CurrentRow.Cells[10].Value.ToString());
}
بعد داخل لود فرم
این را تایپ کنید .
combo();
:n05:
سلام..بهتر اینه که اون فیلد رو به کامبوباکس بایند کنی...
"cmb1.datasource="tablename;
cmb1.displaymember="fieldname";