Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

fetching a particular column in a combobox from a ms access database using c#

$
0
0

i have developed an application for my perfume shop. i have created a windows form in which there are two controls(a button and a combo box). i want to fetch a column (brand name) from the table (HUGO_BOSS) of my ms access database to combo box when i press that button.
i tried the following code and it gives "System.Data.DataRowView"

privatevoid button5_Click(object sender,EventArgs e){

            con.Open();OleDbDataAdapter d =newOleDbDataAdapter("select [Brand name] from HUGO_BOSS", con);DataSet dt =newDataSet();
            d.Fill(dt);
            comboBox3.DataSource= dt.Tables[0];
            comboBox3.DisplayMember="[Brand name]";
            con.Close();}


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>