hi dear,
I don't understand. what you want ? I give some information. Please observe it.
private void FxComboBox()
{
SqlConnection objConn1 = new SqlConnection("Data Source= Sql Server Name ;Initial Catalog= Database Name ;user id=sa; password=123;");
string SQL = "Select * From TableName";
SqlCommand cmd = new SqlCommand(SQL, objConn1);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
comboBox1.DataSource = dt;
comboBox1.DisplayMember = "ColoumName" ;
comboBox1.ValueMember = "ColoumName" ;
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
}
}