none
Saving data from a listbox to an MS Access Database Table RRS feed

  • Question

  • Good Day,

    I was wondering if anyone would happen to know how to save data from a listbox to a database table. The program I'm working requires that a calculated operation, ex. 1 + 1 = 2, be saved from the listbox to the table. The listbox holds a total of 10 operations and each one should be on a new line of the column for operations in the database table. I know how to establish an oleDB connection and a SQL connection. The only part I can't figure out is the save function, moving the data from one to the other. I've tried using datasets and adapters which brought me the closest I feel, but I'm still stuck. Any assistance would be greatly appreciated. 

    Joshua

    Monday, October 16, 2017 12:57 AM

All replies


  • Hi Joshua2608,

    >>The only part I can't figure out is the save function, moving the data from one to the other. I've tried using datasets and adapters which brought me the closest I feel, but I'm still stuck. Any assistance would be greatly appreciated.

    From your description, you can include all necessary code snippets for anyone else to be able to reproduce your issue from scratch along with a detailed description about the results including any exception messages or you can upload your demo to OneDrive(Including your test material). We can download it and debugging. This will help us quickly analyze your problem.
    Share OneDrive files and folders:
    https://support.office.com/en-us/article/Share-OneDrive-files-and-folders-9fcc2f7d-de0c-4cec-93b0-a82024800c07

    Saving data to MS-Access database in vb.net:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/b5cd6473-2890-4113-9bbe-549ab6f08637/saving-data-to-msaccess-database-in-vbnet?forum=vbgeneral

    Best Regards,

    Yohann Lu


    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, October 16, 2017 6:20 AM
    Moderator
  • When working with DataSets/TablAdapter you need to create the query in the designer file (the .xsd) or DataSet/DataAdapter you need to hand code your query.

    It would be helpful if you posted the schema you are working with including what type of database (e.g. MS-Access or SQL-Server).

    If using TableAdapter here are some samples (they don't match your question but give insight to working with designer files).

    Oh, in regards to operators on a new line of the column, that seems inappropriate, can you give a reason why not use multiple rows for operators?


    Please remember to mark the replies as answers if they help and unmark 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.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Monday, October 16, 2017 1:55 PM
    Moderator