Results 1 to 5 of 5

Thread: Adding more than 1 row to dataset

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Ggalla1779's Avatar
    Join Date
    Feb 2006
    Location
    Glasgow
    Posts
    532

    Resolved Adding more than 1 row to dataset

    Hi Guys

    Added 1 rec to Access 2000 db from vb.net (1.1), now want to add more than 1... have I done this right?

    Unsure of syntax/ order

    cheers George


    cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & myDBLoc)
    Dim cmd = New OleDbCommandBuilder(da)
    da = New OleDbDataAdapter("Select * from tblDocs", cn)
    da.Fill(dt)
    cmd = New OleDbCommandBuilder(da)

    Try
    da.Fill(ds, "Scans")
    dt = ds.Tables("Scans")

    Dim dr As DataRow = dt.NewRow()
    Dim di As New System.IO.DirectoryInfo(myFileNetDrive)

    For Each fi As System.IO.FileInfo In di.GetFiles("*.*")
    'lstFiles.Items.Add(fi.Name)
    dr(1) = myKeyNo.Text
    dr(2) = fi.Name
    dr(3) = "9"
    dr(4) = Date.Now

    dt.Rows.Add(dr)
    Next

    da.Update(ds, "Scans")

    Last edited by Ggalla1779; Feb 6th, 2006 at 11:32 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width