Few months ago I encounter a problem with my windows form bound using a DataSet. When I open the form the first time, it seems that everything is fine. But when I open it again the second time, the fields are become blank. This happens when you trigger the “PerformClick” of “BindingNavigator” under the Form Load event.
This is not actually the common mistake that I encounter. But maybe, you encounter this problem also if you are used with VB 6.0 before.
Here’s the code to open the windows form the correct way:
After browsing several forum sites I found so many programmers having problem with ComboBox after they bind it to a DataSet.
The problem actually is not cause by a bug or the like. The error is caused by design. Here’s the following question on the internet that I found that will explain this error further:
http://thedailyreviewer.com/dotnet/view/data-bound-combobox-does-not-leave-focus-106127786
In our previous tutorial I discuss on “How to Create Master/Detail Windows Forms” on our Library System Project.
Today we will add MDI Form and create a main menu to open the forms on our project. If you follow closely this tutorial you will have now several Windows Forms on your project.
Please follow the steps below to Add MDI Form and Main Menu on your Library System project.
If you are using SelectedIndexChanged in your ComboBox may be you encounter a problem with events being fired even if you did not click the ComboBox.
This happens when you open and close your Windows Form. The workaround for this is to use RemoveHandler statement.
Here’s an example: RemoveHandler CreditTermIDComboBox.SelectedIndexChanged, AddressOf CreditTermIDComboBox_SelectedIndexChanged
And when you’re done executing the Form Load event you have to add back the handler again by using the AddHandler statement.
Here’s an example:
On my last tutorial I discuss on “How to Display Data in Windows Forms”. This time I will teach you on “How to Create Master/Detail Windows Forms”.
Creating a master/detail form still requires the same method as displaying data in windows forms. Except that we use additional control called “DataGridView”. This control will display the related record known as child form.
One of the challenging parts in VB.NET is to change the connection string of your database location when you run your application.
This tutorial will help you solve this problem. This will apply only to SQL Server but it can be also modified easily to work with MS Access and other DBMS.
In my case I initialize this on the Form Load event on my Login form.
In order to display data in windows forms all you need to do is drag Items from the Data Sources. For more information, see How to Add New Data Source.
Before you drag the Items (i.e. table name) make sure that you select the display type and type of control that you’d like to appear in the Windows Forms.
To do this expand the Item name and the arrow down to select the display type and type of control which you would like to appear.
Display type
This tutorial will explain on:
If you are running 32 Bit operating system before and were intrigued to install 64 bit OS to improved performance of your computer, then maybe you are having problems debugging your Visual Studio .NET source code.
I am once having this issue which stops me from debugging all of my VB.NET 2008 source code after I installed Windows 7 64 bit.