Wrox Programmer Forums
|
.NET Framework 1.x For discussing versions 1.0 and 1.1 of the Microsoft .NET Framework.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 1.x section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 20th, 2008, 06:37 PM
Registered User
 
Join Date: Feb 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Rebinding a data to combo box

Dear Sir,

I have a form named Employee Form. I Place in that form a combo box that dispaly all Employees. When I add a new employee to the database, it is already added.

The problem is:
when I add a new employee to the database it will not appear in the combo box unless I close the form and then open it..Plz I am doing a big project and I am stick on that point so If you have any example regarding that topic I'll appreciate it.



 
Old April 25th, 2008, 04:39 AM
Registered User
 
Join Date: Apr 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

As far I am able to understand your question
 First method is take a button on Your form and on button'Update' click event

this.DataAdapter1.Update(this.datasetnorthwnd.Cust omers);

When you update the source the data bounded with combo box will get automatically changed




Thanks
neha
 
Old April 25th, 2008, 04:43 AM
Registered User
 
Join Date: Apr 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Closing and opening the form depends on the event with you have done databinding ...if You have a taken a button to retrieve the data from database to combo box then run update command there only and after changing data from database Add one more line

datasetnorthwnd.Acceptchanges();

Thanks
neha





Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering Data from one Combo Box to another Steve1977 ASP.NET 3.5 Basics 1 September 14th, 2008 08:50 AM
Access Data from a combo box darkhalf Access VBA 1 February 22nd, 2008 04:28 PM
Inserting data from combo box bergs77 XSLT 0 January 3rd, 2006 01:09 PM
filling a combo box from a data object allee_man Beginning VB 6 1 March 1st, 2005 08:08 AM
Combo Box - Data In Use MrDannyP Beginning VB 6 1 November 15th, 2003 10:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.