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 8729519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:50:56+00:00 2026-06-13T08:50:56+00:00

I have done a code where I update the given dataset into oracle database

  • 0

I have done a code where I update the given dataset into oracle database using the adapter.Update method in .NET 2.0
However the same piece of code gives exception
“Update requires a valid InsertCommand when passed DataRow collection with new rows”

In case I traverse the dataset and insert each row , it takes a lot of time(over 5000 records).

Please suggest a way to update whole dataset into database at a time.

Thanks in advance

  • 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-13T08:50:57+00:00Added an answer on June 13, 2026 at 8:50 am

    The way to do this is one row at a time

    
    conn=objDbClass.open_connection();
    string cmdStr = "select COL1, COL2   from MY_TABLE";
    OleDbDataAdapter adapter = new OleDbDataAdapter(cmdStr, conn);
    OleDbCommandBuilder builder = new OleDbCommandBuilder(adapter);
    DataSet dataset1 = new DataSet();
    adapter.Fill(dataset1,"Table1");
    string err_txt="";
    int err_cnt=0;
    int call_no=Find_CallNo();
    for (int arcnt=0;arcnt
    DataRow dr1=dataset1.Tables[0].NewRow();
    dr1["COL1"]=drxl["COL1"].ToString();
    dr1["COL2"]=drxl["COL2"].ToString();
    dataset1.Tables[0].Rows.Add(dr1);
    int no_updated_rows = adapter.Update(dataset1,"Table1");
    int len = xlds.Tables[0].Columns.Count;
    }
    }
    }
    

    Here for each row is read from the excel and placed in the dataset's data table. Then the update function of the data adapter is called. hence, in case, if the dataset has 40 rows, the update function will be called 40 times.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have done a code that will download the file from internet. but the
i have done some code in jquery but where i commented in this bellow
I have done a simple code for a slideshow that dynamicly loads images from
The code shows below what i have done till now. Now what i need
i have done self study on learning struts 2. i have used one code
I have done a small project, which consists of 5 excel sheet in, code
Ok, I have the code done in a way that works great and uses
Quick question, What have I done wrong here. The purpose of this code is
Hidden worksheets/workbooks have some limitations to what can be done in VBA code, like
I have some code that I know could be nicer if it's done in

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.