Loading

tutorial

I just want to share with you the code that I have found on the internet on how to open a Cash Drawer using VB.NET.

I am in no way claim this code as my own work. I want to share this with you because there’s a lot of question on the internet on how to open a Cash Drawer on VB.NET.

The code will simply open the cash drawer using either the LPT port or COM port.

Use the following code and test it if it will work on the brand of your cash drawer.

One of the problems that a beginner encounter when there is a project uploaded here, is they do not know on how to change the connection string that points to the correct database location. This is true with MS Access and even with SQL Server. Some programmers don’t add a code that will automatically change the location of the database just in case it will be ported in other machine.

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:

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 my previous tutorial I discuss on “How to Create Database in SQL Server 2005 Express Edition”. This time you will learn how to add a table in your “LibSys” database using SQL Server Management Studio.

Since LibSys database may contain several tables, I will only teach you to create at least one table and the rest will be done by executing a script.

In this tutorial I will teach you on how to create a Windows Application using Visual Basic .NET 2008. For the sake of this tutorial I will be using Library System as the system model.

I came up with this idea in the hope to help beginner who wish to learn Visual Basic .NET the EASY WAY. I know there are a lot of tutorials out there but they focus on different things. Unlike this tutorial I will create an actual application which will guide you up to the end of this article.

I feel it would be necessary to create a tutorial on how I program the ComboBox in DataGridView. So, this tutorial will guide you on how to:

  1. Add DataSet
  2. Create a master/detail form
  3. Add ComboBox in DataGridView

How to add a DataSet

1. Click on the Data Sources.

2. Click Add New Data Source.

In this tutorial I will teach you on how to display related record based on the selection value from a ComboBox.

The example displays a student’s subject in a DataGridView after a SelectedIndexChanged event of a ComboBox.

This tutorial assumes that you already know how to add a DataSet in your project.

The following are important steps in order to understand how I made this simple program.

1. Bind a ComboBox

[inline:ComboBox_Data_Binding.jpg=Bind a ComboBox]

2. Add a query in the Course Table under DataSet designer

Language: 

In this tutorial I will teach you on how to create report using Data Report in Visual Basic 6.0. The source code contain here is based on my previous submission called Simple Example of Connecting Database Using Data Environment except that I added a Data Report in this tutorial.

Today I want to share with you what I have discovered in setting a text or value in databound textbox in Visual Basic .NET. I almost spend a day figuring out how to do this. While the internet is my assistant all the time, sometimes it is inevitable that the information is outdated and we cannot find the correct answer as expected.

Scenario

You bound a TextBox using a DataSet and you want to change the value to something like an auto-generated key. While this can be done easily as we may think like the following code:

Pages