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

  • Home
  • SEARCH
  • 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 4339512
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:13:34+00:00 2026-05-21T11:13:34+00:00

I created a new dataset as DataSet local_ds2 = new DataSet(); I tried this

  • 0

I created a new dataset as

DataSet local_ds2 = new DataSet();

I tried this to add rows and columns dynamically

DataColumn dcAmount = new DataColumn("EmpID");
    local_ds2.Tables["ACHFile"].Columns.Add(dcAmount);

    DataColumn dcName = new DataColumn("Name");
    local_ds2.Tables["ACHFile"].Columns.Add(dcName);

    DataColumn dcBnkRoutingNumber = new DataColumn("BankRoutingNumber");
    local_ds2.Tables["ACHFile"].Columns.Add(dcBnkRoutingNumber);

    DataColumn dcBnkAccount = new DataColumn("BankAccount");
    local_ds2.Tables["ACHFile"].Columns.Add(dcBnkAccount);

    DataColumn dc = new DataColumn("Amount");
    local_ds2.Tables["ACHFile"].Columns.Add(dc);

    DataColumn dc1 = new DataColumn("BankAccountTypeID");
    local_ds2.Tables["ACHFile"].Columns.Add(dc1);

    for (int i = 0; i < chkcnt; i++)
    {
        local_ds2.Tables["ACHFile"].Rows[i]["EmpID"] = EmpID[i];
        local_ds2.Tables["ACHFile"].Rows[i]["Name"] = Empname[i];
        local_ds2.Tables["ACHFile"].Rows[i]["BankRoutingNumber"] = BnkRoutingNumber[i];
        local_ds2.Tables["ACHFile"].Rows[i]["BankAccount"] = BnkAccount[i];
        local_ds2.Tables["ACHFile"].Rows[i]["BankAccountTypeID"] = AchDB.strBankTypeID[i];
        local_ds2.Tables["ACHFile"].Rows[i]["Amount"] = AchDB.Amount1[i];
        if (AchDB.strBankTypeID[i].ToString() == "D")
            strBankAccntType = "BankAccountTypeID='" + AchDB.strBankTypeID[i].ToString() + "'";
    }

But I am unable to add columns and rows dynamically can any one help me

  • 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-05-21T11:13:34+00:00Added an answer on May 21, 2026 at 11:13 am

    Try changing your code to this

    DataRow dr;        
    
    for (int i = 0; i < chkcnt; i++)
            {
                dr = local_ds2.Tables["ACHFile"].NewRow();
                dr["EmpID"] = EmpID[i];
                dr["Name"] = Empname[i];
                dr["BankRoutingNumber"] = BnkRoutingNumber[i];
                dr["BankAccount"] = BnkAccount[i];
                dr["BankAccountTypeID"] = AchDB.strBankTypeID[i];
                dr["Amount"] = AchDB.Amount1[i];
                if (AchDB.strBankTypeID[i].ToString() == "D")
                    strBankAccntType = "BankAccountTypeID='" + AchDB.strBankTypeID[i].ToString() + "'";
                local_ds2.Tables["ACHFile"].Rows.Add(dr);
            }
    

    You are not adding the rows to the Datatable

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

Sidebar

Related Questions

I created a new ASP.NET MVC application. The home page looks like this: I
I created a new View (LogView) in Infrastructure.Module project. This view will be used
I created a new content type for a wiki page library. I added this
I've created a web site that uses classic ASP.NET caching: DataSet ds = new
I am trying to add data to a newly created column... DataSet ds =
I've created new db via phpMyAdmin and while editing db privilages clicked delete localhost
Lets go from the start Created New Xcode project,opened interface builder dragged one NSButton
i'm using eclipse platform and window builder pro within. I've already created new project
I created a new HalloWorld Makefile Project. There is a HalloWorld.cpp with my main
I created a new project with the following code segment: char* strange = (Strange??);

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.