It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

need help with my project work

Moderator: dafunkymunky

need help with my project work

Postby princessfi on Fri Jul 18, 2008 4:54 pm

Hi,
I'm new to visual basic. I have a problem. i connected the database to the form and i added the code below to prompt if there is any blank textbox. When nothing is entered into the textbox and when the first box is left blank, there should be a prompt that says please enter rented videos. However that does not appear and instead there is an error. "Me.Rented_VideosBindingSource.EndEdit()" is highlighted and a message box appears saying NoNullAllowedException. Please help me. Thanks alot in advance! :) :)

This is the program.

Code: Select all
Public Class RentedVideos
   
    Private Sub Rented_VideosBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rented_VideosBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.Rented_VideosBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.Digital_Video_DatabaseDataSet1)

        If Rented_VideosTextBox.Text = "" Then
            MessageBox.Show("Please enter rented videos.")
        ElseIf (Videos_IDTextBox.Text = "") Then
            MessageBox.Show("Please enter videos ID.")
        ElseIf (PriceTextBox.Text = "") Then
            MessageBox.Show("Please enter Price.")
        ElseIf (Customers_NameTextBox.Text = "") Then
            MessageBox.Show("Please enter customers name.")
        ElseIf (Customers_ContactTextBox.Text = "") Then
            MessageBox.Show("Please enter Customers Contact.")
        Else
            Dim RentedVideos As New RentedVideos
            Rented_VideosTextBox.Text = ""
            Videos_IDTextBox.Text = ""
            Customers_NameTextBox.Text = ""
            MessageBox.Show("Customer Database successfully added.")
        End If

    End Sub

    Private Sub RentedVideos_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'Digital_Video_DatabaseDataSet.Videos_Titles' table. You can move, or remove it, as needed.
        Me.Videos_TitlesTableAdapter.Fill(Me.Digital_Video_DatabaseDataSet.Videos_Titles)
        'TODO: This line of code loads data into the 'Digital_Video_DatabaseDataSet1.Rented_Videos' table. You can move, or remove it, as needed.

        Me.Rented_VideosTableAdapter.Fill(Me.Digital_Video_DatabaseDataSet1.Rented_Videos)

    End Sub[size=18][/size]
[/code]
princessfi
 
Posts: 0
Joined: Fri Jul 18, 2008 4:11 pm

Who is online

Users browsing this forum: No registered users and 4 guests