Dear all,
I have created project database in msaccessdatabase. It contail
form layout as shown in image & i have attached code for reference
Imports System
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Project_DatabaseDataSet.Project_Data' table. You can move, or remove it, as needed.
Me.Project_DataTableAdapter.Fill(Me.Project_DatabaseDataSet.Project_Data)
Dim dt As New Project_DatabaseDataSet.Project_DataDataTable
For Each col As DataColumn In dt.Columns
col.AllowDBNull = True
Next
Me.Project_DataTableAdapter.FillByMountingType(dt)
cbo_MountingType.DisplayMember = "Mounting Type"
cbo_MountingType.DataSource = dt
End Sub
Public Sub BindCombox()
BindComboBox1.DataSource = Project_DatabaseDataSet.Tables("Mounting Type")
BindComboBox1.DisplayMember = "product Name"
End Sub
Public Sub BindComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles BindComboBox1.SelectedIndexChanged
End Sub
Private Sub BindingNavigatorDeleteItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorDeleteItem.Click
End Sub
Private Sub Project_DataBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles Project_DataBindingNavigatorSaveItem.Click
Me.Validate()
Me.Project_DataBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Project_DatabaseDataSet)
End Sub
Private Sub Bt_ADD_Click(sender As Object, e As EventArgs) Handles Bt_ADD.Click
Project_DataBindingSource.AddNew()
End Sub
Private Sub BT_Remove_Click(sender As Object, e As EventArgs) Handles BT_Remove.Click
Project_DataBindingSource.RemoveCurrent()
End Sub
Private Sub Bt_Load_Project_Click(sender As Object, e As EventArgs) Handles Bt_Load_Project.Click
End Sub
Private Sub Bt_Search_Click(sender As Object, e As EventArgs) Handles Bt_Search.Click
Me.Project_DataTableAdapter.FillByAllProject_dataFromMountingType(Me.Project_DatabaseDataSet.Project_Data, cbo_MountingType.Text)
End Sub
Private Sub Bt_Project_Save_Click(sender As Object, e As EventArgs) Handles Bt_Project_Save.Click
Try
Me.Project_DataBindingSource.EndEdit()
Project_DataTableAdapter.Update(Project_DatabaseDataSet.Project_Data)
MessageBox.Show("Data being saved ")
Catch ex As Exception
MessageBox.Show("Error while saving data")
End Try
End Sub
End Class
Problem i am facing.
1) whenever new data being entered data being populated in datagrid view. If i open ms access database file i found data not being saved
2)I have attached database file for reference . Mounting type & pvsys type are listed value. How to assign combobox value into ms access data base columns .
3)whenever add key is pressed first value store will be empty how to make it to store value with current value
4) Whenever new key pressed how to clear all field & make user to add New values.