Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
How To Refresh ComboBox ?
Ajit N
Jan 19 2017 1:58 AM
227
Reply
Hi, I want to refresh the combobox. when i update data in child form, the combobox will be update in parent form. i tried following code it will update, but in combobox it also displayed the previous data.
so help me how can i refresh combobox ?
This is my code....
private
void
StudentRegistration_Load(
object
sender, EventArgs e)
{
cmbclass.Items.Clear();
FillClass();
}
public
void
FillClass()
{
SqlCommand cmdfill =
new
SqlCommand(
"select Class from AddClass"
, con);
SqlDataReader drfill = cmdfill.ExecuteReader();
while
(drfill.Read())
{
cmbclass.Items.Add(drfill[0]);
}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
Writting text on PDF
Code not working Properly