Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8846817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:05:37+00:00 2026-06-14T12:05:37+00:00

I keep having this error within a line of my code and I can’t

  • 0

I keep having this error within a line of my code and I can’t seem to fix it.

Here is my code:

con.Open()
    Dim dt As DataTable
    Dim ds As DataSet
    ds.Tables.Add(dt)
    Dim da As OleDbDataAdapter

    da = New OleDbDataAdapter("Select From * product info", con)
    da.Fill(dt)

    Dim newRow As DataRow = dt.NewRow
    With newRow
        .Item("Product Name:") = txtItemName.Text
        .Item("Description") = txtDescription.Text
        .Item("Quantity:") = txtItemCount.Text
        .Item("Type:") = cmbItemType.Text
        .Item("Date Received:") = txtDate.Text
        .Item("Barcode:") = txtBarcode.Text
        .Item("Price:") = txtPrice.Text
    End With

    dt.Rows.Add(newRow)
    Dim cb As OleDbCommandBuilder(da)
    da.Update(dt)
    con.Close()

In the Dim cb As OleDbCommandBuilder(da) line I get the error on the da

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:05:38+00:00Added an answer on June 14, 2026 at 12:05 pm

    You have mixed the initialization and declaration of the variable cb.
    The correct syntax to use is

    Dim cb As OleDbCommandBuilder = new OleDbCommandBuilder(da)
    

    or

    Dim cb As OleDbCommandBuilder      'declaration
    cb = new OleDbCommandBuilder(da)   'initialization
    

    or (as explained by Konrad below)

    Dim cb As New OleDbCommandBuilder(da)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having this problem where I keep getting this error in my console: *
I keep getting this error with HG (Mercurial), it seems like it's having a
i am having a problem creating RMIserver class because i keep getting this error
Having this annoying error. I keep getting undefined reference to class::method This is the
I keep getting this error when trying to run the code: (let ((exp lambda
So I keep getting this error when trying to compile C++ code using CodeBlocks.
I keep having this error when I'm trying to integrate Spring JMS into my
Hi I keep having this error while I try to valide a qti xml
I keep having an error when running my web application. The error does not
I keep getting a Run Time error that says I am having an Exception

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.