need help with my project work

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • princessfi
    New Member
    • Jul 2008
    • 3

    need help with my project work

    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_Vide osBindingSource .EndEdit()" is highlighted and a message box appears saying NoNullAllowedEx ception. Please help me. Thanks alot in advance! Smile Smile

    This is the program.

    Code:
    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
    Last edited by Curtis Rutland; Jul 19 '08, 06:40 AM. Reason: Added code tags -- Please use the # button
  • Daxthecon
    New Member
    • Jul 2008
    • 63

    #2
    First I got to get this in before you get yelled at by the moderators to use the [Code] Tag on your code so we can help you better. Secondly we can't do stuff for you but your problem is within the scope so please phrase it better. There now you shouldn't get moderator'd. Now as per your problem give me some time and I'll edit this post or Plater or Alias will help you first.

    Comment

    • princessfi
      New Member
      • Jul 2008
      • 3

      #3
      hi,
      i'm really quite new to this and i'm not sure how to edit the question which i have currently posted. I'm so sorry that i didn't add the code Tag. I am really new at this and I know this isn't an excuse but i'm sorry if i didn't ask the question right. I tried many ways to solve the problem but i'm still unable to find out what is causing it. It was also very difficult for me to explain the situation as I've just been using Visual Basic for a month.

      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_Vide osBindingSource .EndEdit()" is highlighted and a message box appears saying NoNullAllowedEx ception. Please help me. Thanks alot in advance! Smile Smile
      Last edited by Curtis Rutland; Jul 19 '08, 06:40 AM. Reason: didn't need to post all your code twice.

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        Welcome to Bytes!

        We appreciate it if you read the Posting Guidelines. This can also be found by clicking the help link near the search at the top of the page. Specifically, we like you to put [CODE] tags around your code so that it is formatted properly and is easier to read. And as you know, if it is easier to read and understand, it will be easier for the Experts to help you out. Basically, what you can do is paste your code in, highlight it, and click the # button on the text editor.

        I edited both of your posts to correct this, and I removed the code from your second post, seeing as it was the same as in the first.

        Once again, welcome to Bytes! Enjoy your stay here.

        MODERATOR

        Comment

        • princessfi
          New Member
          • Jul 2008
          • 3

          #5
          Thanks for adding the tags

          Comment

          Working...