Sub btnSave_Click(sender As Object, e As EventArgs) Dim objConn As New SqlConnection Dim objCmd As New SqlCommand Dim strConnString,strSQL As String strConnString = "Server=localhost;UID=sa;PASSWORD=;database=mydatabase;Max Pool Size=400;Connect Timeout=600;" strSQL = "INSERT INTO customer (CustomerID,Name,Email,CountryCode,Budget,Used) " & _ " VALUES " & _ " ('" & Me.txtCustomerID.Text & "','" & Me.txtName.Text & "','" & Me.txtEmail.Text & "', " & _ " '" & Me.txtCountryCode.Text & "','" & Me.txtBudget.Text & "','" & Me.txtUsed.Text & "')" objConn.ConnectionString = strConnString objConn.Open() With objCmd .Connection = objConn .CommandText = strSQL .CommandType = CommandType.Text End With Me.pnlAdd.Visible = False Try objCmd.ExecuteNonQuery() Me.lblStatus.Text = "Record Inserted" Me.lblStatus.Visible = True Catch ex As Exception Me.lblStatus.Visible = True Me.lblStatus.Text = "Record can not insert Error ("& ex.Message &")" End Try objConn.Close() objConn = Nothing End Sub