Second Way - By Iteration
public DataTable retrievevalues()
{
SqlCommand cmd = new SqlCommand("StoredProcedure", sqlconn);
cmd.Parameters.AddWithValue("@userid", username);
cmd.CommandType = CommandType.StoredProcedure;
sqlconn.Open();
SqlDataReader dr = cmd.ExecuteReader(System.Data.CommandBehavior.Default);
DataTable dt = new DataTable();
dt.Load(dr);
return dt;
}
NOTE: @userid is an Stored Procedure Variable you can ignore that.
-----------------------------------------------------
DataTable DT = new DataTable();
DT = retrievevalues();
foreach (DataRow row in DT.Rows)
{
combobox1.items.add(row["SQL ColumnName"].ToString()
}
)
-----------------------------------------------------