Wrox Programmer Forums
|
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 23rd, 2008, 06:49 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default capture data in datagridview

Hi All,
Hope someone here can help me. I've been searching all day to no avail. I've found multiple ways to put data into a datagridview, but when it comes to taking it from the datagridview to a table I come up empty. I may be trying to do something that can't be done, but what I want to do is have a click event inwhich the data in the datagrid is saved to a table in my dataset and updated to the database. Below is the code I use to populate the grid, but so far reverse engineering has netting me a good result.

Private mAdapter As New OleDb.OleDbDataAdapter()
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;data source='I:\Wave_Selection\Wave_Selection.mdb';Pers ist Security Info=False"
        'Load DataGridView

        mAdapter.SelectCommand = _
            New OleDb.OleDbCommand(SQL1, New OleDb.OleDbConnection(connectionString))

        'Auto-Generate INSERT, UPDATE and DELETE sql commands
        Dim cb As New OleDb.OleDbCommandBuilder(mAdapter)

        'Fill table
        Dim table As New DataTable()
        mAdapter.Fill(table)
        'Set as DataSource for grid
        Me.dgResults.DataSource = table






Similar Threads
Thread Thread Starter Forum Replies Last Post
Capture and emaio formview control data nuttylife2 ASP.NET 1.x and 2.0 Application Design 0 August 1st, 2006 11:44 AM
capture check box data into mysql osemollie PHP How-To 0 January 30th, 2006 12:18 PM
capture data from lpt1 sal21 Excel VBA 0 November 8th, 2005 09:57 AM
Data capture apps for PDAs with VB.NET badgolfer VS.NET 2002/2003 2 September 3rd, 2005 08:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.