hi guy's
-----------------------------
my project have a database (access) with 3 table ...
how to show field from database (ID or Name of table 1) in comboBox ?
then insert in table B ...!
thank's
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Guest UserPosted Aug 12, 2014, 11:12 PM
but you've to write code when user select value in combo box it should be inserted into new table.
something like this shall work for you:
da.newRow(combo1.value);
da.insert();
i may be wrong syntactically but algorithm is right
ghasem dehPosted Aug 12, 2014, 1:55 AM
this code is OK
DataTable table = new DataTable();
string sql = "Select New from Album";
con.Open();
OleDbDataAdapter da = new OleDbDataAdapter(sql, con);
da.Fill(table);
table.Rows.Add(" ");
comboBox1.DataSource = table;
comboBox1.DisplayMember = "New";
comboBox1.ValueMember = "New";
comboBox1.SelectedValue = " ";
Guest UserPosted Aug 12, 2014, 12:09 AM