none
Datagridview to MS Access 2019 RRS feed

  • Question

  • Hi!

    somebody help me with these codes?

    I cannot save data on my database access. the data on the datagrid came from textbox and it adds the data via ADD button. Here's the code below.

    Hope someone can help me. thank you..

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click

            table.Rows.Add(txtWorkOrderNo.Text, Item_CodeTextBox.Text, RevTextBox.Text, Default_RevTextBox.Text, Item_NameTextBox.Text, STD_Packaging_QTYTextBox.Text, txtquantitybarcode.Text, txtquotient.Text)
            Barcode_SeriesDataGridView.DataSource = table

            Me.Validate()
            Me.Barcode_SeriesBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.DatabaseDataSet)

            txtWorkOrderNo.Text = ""
            Item_CodeTextBox.Text = ""
            RevTextBox.Text = ""
            Default_RevTextBox.Text = ""
            Item_NameTextBox.Text = ""
            STD_Packaging_QTYTextBox.Text = ""
            txtquantitybarcode.Text = ""
            txtquotient.Text = ""

    Friday, August 16, 2019 1:16 AM

All replies

  • Hello,

    • Is there an error? 
    • Has this ever worked?
    • Have you set under properties in solution explorer "Copy to Output Directory" to Copy always or Copy if newer? (for the database which should be shown in Solution Explorer)

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange


    Friday, August 16, 2019 9:53 AM
    Moderator
  • Dear Ms. Karen,

    I've already set the properties but still the same.

    No data on the database and no error upon running the system.

    Hope you can help me..

    Thank you!

    Monday, September 2, 2019 5:16 AM
  • Hi,

    vb.net code should not have any issue,see the following link

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/34270bd6-aeb9-4f75-945a-34a983858226/tableadaptermanager-hierarchical-update-not-working?forum=vbgeneral

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Monday, September 2, 2019 7:53 AM
  • Dear Ms. Karen,

    I've already set the properties but still the same.

    No data on the database and no error upon running the system.

    Hope you can help me..

    Thank you!

    Well working TableAdapter we really can't ask much more about code so the last thing is to ask if the TableAdapterManager was added by you or the data wizard process. If added by the data wizard you should see the following below the form and if not that can be an issue, other than that if you altered the original setting of any of the components below that can also be an issue.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Monday, September 2, 2019 9:31 AM
    Moderator
  • Hello,

    Your code didn't contain all required details.

    You have "table" and you have "TableAdapterManager". If after call TableAdapterManager.UpdateAll(...) there are no data in the database table there could be:

    - connection to different database

    - desynchronisation of DataSet and database

    - error in data which affects SQL (rear)

    - "table" is not a table from "TableAdapterManager" (most likely)

    P.S. table.Rows.Add(object[] ...) - used relatively rarely - there will be a trouble to match fields against data in the args and you may miss changes in the database. Use table.Rows["fieldName"] = textBox.Text; or do strongly typed datatable 


    Sincerely, Highly skilled coding monkey.

    Monday, September 2, 2019 9:52 AM