Hi

I am developing a windows application.

For your infomation

FRONT END : C# (VISUAL STUDIO 2008)
BACKEND : SQL SERVER 2008

In a single form I have an option for add and remove books. Two different buttons are used(Add and Remove Books).

When I click on Add button the particular book name entered in the textbox is added to the database.

For Removing books I am using a combo box which is populated with the values from the database(the same table where the add button stores the book name).

Now when I add a particular book by clicking on the add button, now if I wish to remove the same book I have to close the form and again re-open it to remove it. If I dont close and re-open the newly entered book is not populated to the combo box.

In the add button I have included the following code to refresh the form

this.Refresh();

But still I am not able to do this.

Can anybody help me out in performing this task?

Thanks in advance!

This isn't a problem with refreshing the form. It sounds like you're populating the combo box from the database only when the form opens. You also should call this method after you add OR remove an item from the database. Can you upload a sample project or paste your code up here so we can take a look?

This isn't a problem with refreshing the form. It sounds like you're populating the combo box from the database only when the form opens. You also should call this method after you add OR remove an item from the database. Can you upload a sample project or paste your code up here so we can take a look?

Thanks a lot for your prompt reply.

Now it is working properly.

It is not necessary to refresh the form, its enough to refresh the control(combobox). Call Refresh method of the combobox you want to reload.

This question has already been answered. Start a new discussion instead.