dcsimg
Results 1 to 1 of 1

Thread: adding data into database

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2014
    Posts
    30

    adding data into database

    Dear all,

    I am trying to add values into data base.

    Problem i am facing
    1) while adding data first time , data not being recorded into data base. data enter second time being recorded , can be edited successfully .

    How to make data visible while data enter for first time

    2) In my code , I am saying

    Code:
    Private Sub BindingNavigatorAddNewItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorAddNewItem.Click
            Project_Data_TableBindingSource.AddNew()
    
        End Sub
    If any of data not entered it should give error related to relevant field.

    3)Load data

    How can i carry forward selected data into next form with non editable option.Here is my panel data Form. I would like to load select project data into group box allocated . But group box element should be non editable.

    Panel Data form
    Name:  Panel_data.jpg
Views: 270
Size:  28.2 KB


    Project data form
    Name:  project_detail_form.jpg
Views: 311
Size:  31.0 KB


    My main form code: this will call project details forms

    Code:
    Public Class Form1
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    
        End Sub
    
        
        Private Sub Bt_Project_Details_Click(sender As Object, e As EventArgs) Handles Bt_Project_Details.Click
            Me.Hide()
            Project_Details_Form.Show()
    
        End Sub
    
    
    End Class


    Project Detail Form .

    Code:
    Public Class Project_Details_Form
    
        
    
        Private Sub Project_Details_Form_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            'TODO: This line of code loads data into the 'Project_Data_Set.Project_Data_Table' table. You can move, or remove it, as needed.
            Me.Project_Data_TableTableAdapter.Fill(Me.Project_Data_Set.Project_Data_Table)
    
        End Sub
    
        Private Sub Bt_Load_Project_Click(sender As Object, e As EventArgs) Handles Bt_Load_Project.Click
    
        End Sub
    
    
        Private Sub Bt_Cancel_Click(sender As Object, e As EventArgs) Handles Bt_Cancel.Click
            Me.Hide()
            Form1.Show()
        End Sub
    
    
    
    
    
    
    
        Private Sub BindingNavigatorAddNewItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorAddNewItem.Click
            Project_Data_TableBindingSource.AddNew()
    
    
    
    
    
        End Sub
    
        Private Sub Project_Data_TableBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles Project_Data_TableBindingNavigatorSaveItem.Click
            Me.Validate()
            Me.Project_Data_TableBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.Project_Data_Set)
    
        End Sub
    
    
    
        Private Sub BindingNavigatorDeleteItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorDeleteItem.Click
            Project_Data_TableBindingSource.RemoveCurrent()
        End Sub
    
        Private Sub FillByToolStripButton_Click(sender As Object, e As EventArgs)
            Try
                Me.Project_Data_TableTableAdapter.FillBy(Me.Project_Data_Set.Project_Data_Table)
            Catch ex As System.Exception
                System.Windows.Forms.MessageBox.Show(ex.Message)
            End Try
    
        End Sub
    End Class
    Last edited by AJITnayak; Aug 31st, 2015 at 06:04 AM. Reason: Panel detail Form Being added.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width