Results 1 to 2 of 2

Thread: Adding table to Database...

  1. #1
    I could stop if I wanted to Ogre's Avatar
    Join Date
    2005-06
    Location
    In the end, Cauliflower is just albino Broccoli
    Posts
    288
    Login to Give a bone
    0

    Default Adding table to Database...

    I have been able to edit & update data in tables that have been created, but now I want to create a table mid code...I have everything working except when I check the database in access, the table that I created is not there...Please help!!!!

    Here is the code for creating the new table:

    Code:
            Dim dtLine As New ViewerDBDataSet.TEMPLATE_QuoteLineItemDataTable
            dtLine = dtLine.Copy
            dtLine.TableName = "LineItemInfo_" & Me.txtQuoteNum.Text
            Try
                Dim item As Object
                Dim index As Integer = 0
                For Each item In arychkCustom
                    row = dtLine.NewRow
                    row(0) = (index + 1).ToString
                    row(1) = item.checked
                    row(2) = arytxtQty(index).Text
                    If item.checked = True Then
                        row(3) = arytxtGPN(index).Text
                    Else
                        row(3) = arycbxGPN(index).Text
                    End If
                    row(4) = arytxtDesc(index).Text
                    dtLine.Rows.Add(row)
                    index += 1
                Next
    
                Me.ViewerDBDataSet1.Tables.Add(dtLine)
                Me.ViewerDBDataSet1.AcceptChanges()
    I start off copying a table in order to get the correct schema...This table that I copy from is only used as a template and contains no data...

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,400
    Login to Give a bone
    0

    Default Re: Adding table to Database...

    The dataset object is just an image of a db. It only exists in ram. You need to use ado to persist your changes to a file. You can then link your dataset to an ado object.
    C:> ED WORKING....

Similar Threads

  1. Adding database info to objects in Map3d
    By kylejrausch in forum AutoCAD Map 3D - General
    Replies: 12
    Last Post: 2012-08-31, 04:14 PM
  2. Importing data from a database table into a dwg
    By everpat in forum AutoCAD Customization
    Replies: 1
    Last Post: 2006-10-10, 12:29 PM
  3. Database table add record problem
    By lambertm in forum VBA/COM Interop
    Replies: 1
    Last Post: 2005-03-09, 02:57 PM
  4. Create Database Table
    By lambertm in forum VBA/COM Interop
    Replies: 2
    Last Post: 2004-06-04, 04:34 PM

Posting Permissions

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