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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:25:34+00:00 2026-05-18T08:25:34+00:00

First off, I’ve only started working with databases and c# so I could be

  • 0

First off, I’ve only started working with databases and c# so I could be making a really stupid mistake here so apologies in advance. I’m connected to a SQL server express database and can read from it fine, however whenever I have updated my DataSet to add new columns and then try to update the data source it wont update successfully. Code below:

        DataColumn newColumn;
        SqlCommandBuilder cmdBuild = new SqlCommandBuilder(_myAdapt);

        foreach (String s in myList)
        {
            newColumn = new DataColumn(s, System.Type.GetType("System.String"));
            _myData.Tables["Table1"].Columns.Add(newColumn);
        }

        _myAdapt.Update(_myData, "Table1");

Anyone got any suggestions as to why this wont work? I’ve debugged it and the data set is definitely being updated with the new columns but I cant seem to update the data source.

Thanks for any responses.

  • 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-18T08:25:34+00:00Added an answer on May 18, 2026 at 8:25 am

    Does that column exist in the database (and just not in your database), or are you trying to ALTER the table definition in the database using the dataset.

    I don’t believe the 2nd of the above is possible. Your dataset needs to have a column structure to match that of the database table that you’re updating. You can however add as many rows as you like to the dataset and they will all INSERT to the database fine.

    If you feel you have a need to add columns to your table at run-time I’d suggest revisiting your data-model. Where possible your column definitions should be be unchanging over time, to represent the main attributes of the data entities you’re storing.

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

Sidebar

Related Questions

This is beyond both making sense and my control. That being said here is
I've found several jQuery syntaxes for nullifying the enter on a form. First one:
I was reading JavaScript: The Good Parts and the author mentions that JavaScript is
I'm trying to build a C++ extension for python using swig. I've followed the
I am attempting to pull some information from my tnsnames file using regex. I
Let say I have the following desire, to simplify the IConvertible's to allow me
After having read Ian Boyd 's constructor series questions ( 1 , 2 ,
I am using a 3rd-party rotator object, which is providing a smooth, random rotation

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.