Quote:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.OleDb; namespace combox { public partial class Form1 : Form { public Form1() { InitializeComponent(); } string str = ""; OleDbCommand com; private void Form1_Load(object sender, EventArgs e) { OleDbConnection con = new OleDbConnection(@"put your connection string"); con.Open(); // select query which fetch record to bind in combobox str = "select * from tbl_name"; com = new OleDbCommand(str, con); OleDbDataReader reader = com.ExecuteReader(); while (reader.Read()) {// replace your combobox name comboBox1.Items.Add(reader["name"]); } reader.Close(); con.Close(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)