Tutorials

How to Cancel Delete in BindingNavigator

Submitted by admin on
When you add a DataSet to your Windows Form a BindingNavigator is automatically created with navigation to your record and it also includes Delete and Add button. When you click the Delete button there is no confirmation if you want to cancel the operation. The solution to this is to set the DeleteItem to None.

Get the ID of Last Inserted Record in SQL Server

Submitted by admin on

Sometimes you need to know the value of your Primary Key when you insert record in your table. This is true if you have a Master/Detail form and you need to know the Primary key value of the parent table so that you can insert rows in the related table.

Consider the following scenario:

How to Concatenate Column Values from Multiple Rows

Submitted by admin on

Just want to share with you on how to concatenate or combine one or more values from multiple rows. This SQL code is part of my “Online Hotel Reservation” project.

The idea here is to group column values while concatenating the other column to avoid duplicate records.

Here’s an example:

I have the following record on my table:

What is BlueJ

Submitted by onyx_ash08 on
BlueJ is an integrated Java environment specifically designed for introductory teaching. BlueJ was developed at a University specifically for the purpose of teaching object orientation with Java. BlueJ is free!

Solution to “System.Data.InvalidConstraintException: ForeignKeyConstraint” error

Submitted by admin on
If you encounter the following error: System.Data.InvalidConstraintException: ForeignKeyConstraint FK_foreign_key_name requires the child key values (-1) to exist in the parent table. Or The INSERT statement conflicted with the FOREIGN KEY constraint "FK_foreign_key_name ". The conflict occurred in database "YourDatabase", table "dbo.Tablename", column 'YourPrimaryKey'. The statement has been terminated. Probably you are using a Parent-Child table or Master-Detail table.

SQL server 2008 Save,Edit,Delete and Search from Datagridview Vb.net 2008

Submitted by princenathan on
Imports System.Data Imports System.Data.SqlClient Public Class frmRID Dim sCommand As SqlCommand Dim sAdapter As SqlDataAdapter Dim sBuilder As SqlCommandBuilder Dim sDs As DataSet Dim sTable As DataTable Private Sub cnew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cnew.Click Call main() Con.Open()

Connect to SQL Server 2008 through TCP / IP Using VB.NET 2008 Project

Submitted by princenathan on
Hi this is Vb.net connect sql server using TCP/IP before run this program you need to install a vb.net 2008 and sql server 2008 here in example code: Hi you need to do this click all program/ ms sql server 2008 / configuration tool then click SQL server configuration manager select you server name then rigth click properties you need to enable a TCP and IP add then Restart

How to Store Data Under %appdata% Using Visual Basic .NET

Submitted by admin on

Sometimes we need to store some data or files under %appdata%. If you are using Windows 7 you can find this folder under C:\Users\Username\AppData.

AppData is a folder used to store information like cookies, Libraries, program settings, temporary files, templates, etc.

By using this folder you are certain that your settings are being protected by Windows.

To access this folder, all you have to do is use the following code: