473,379 Members | 1,184 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Adding Row and Column to the same table at the same time.

I have a datatable that was created within a dataset. I dynamically add columns to the table as I add data. Previously added rows probably did not have data for the column that is being added. Since I’m added rows and maybe columns at the same time, what is column content for rows that have been added earlier? Are the data rows for the newly add colum equal nulls or zero length?

Thanks

Nov 20 '05 #1
2 1335
KC
what is column content for rows that have been added earlier?

Nothing.

You have to define your columns first, then add rows to the table. The cells
will be null until you add something (assuming you allowed nulls in the
column.

Ken

"Larry Bird" <La*******@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
I have a datatable that was created within a dataset. I dynamically add columns to the table as I add data. Previously added rows probably did not
have data for the column that is being added. Since I'm added rows and
maybe columns at the same time, what is column content for rows that have
been added earlier? Are the data rows for the newly add colum equal nulls
or zero length?
Thanks

Nov 20 '05 #2
Larry,
In addition to KC's comments.
Are the data rows for the newly add column equal nulls or zero length? When you tried it, what were the values in those columns?

Seeing as it sounds like you already having a working solution, when you add
a new column what value shows up in previous rows?

I would expect it is dependant on the DataColumn being added. If you add an
Auto Increment column that the value for previous rows will be an auto
incremented amount, if you have a computed column, it will be the value of
the Expression. If you have set the DefaultValue it will be the default
value, if you did not set the default value, it will be the DefaultValue's
default (DBNULL.Value), unless of course you have AllowDBNull is false...

Hope this helps
Jay

"Larry Bird" <La*******@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com... I have a datatable that was created within a dataset. I dynamically add columns to the table as I add data. Previously added rows probably did not
have data for the column that is being added. Since I'm added rows and
maybe columns at the same time, what is column content for rows that have
been added earlier? Are the data rows for the newly add colum equal nulls
or zero length?
Thanks

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Paul | last post by:
Hi I have a table that currently has 466 columns and about 700,000 records. Adding a new DEFAULT column to this table takes a long time. It it a lot faster to recreate the table with the new...
3
by: Claudio Lapidus | last post by:
Hello Now perhaps this is a bit dumb, but... I just populated a new table via \copy. After that, I realize that perhaps is a good thing to have a row identifier in it, so I try clapidus=>...
2
by: David Shadovitz | last post by:
I need to add a column to a table. This table holds several thousand records, has several indexes, and serves as the parent table to a few child tables. When I've done this in the past, it has...
2
by: Chris Cobb | last post by:
I have a table that currently contains 718000 rows. I wish to add a column to the table. Adding this column anywhere other than the end of the table requires exporting data, a drop and recreate,...
11
by: Bobbak | last post by:
Hello All, I have these tables (lets call it ‘EmpCalls', ‘EmpOrders', and ‘Stats') that each contain the list of EmployeeIDs, I want to be able to create a Module in which I could call in my VB...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
3
by: Robin Thomas | last post by:
I am fairly new to ASP.NET so I think I am missing something fundamental. Anyway, quite often I am pulling data from a database, but then I need to use that data to produce more data. A simple...
1
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple...
16
by: Geoff Jones | last post by:
Hi Can anybody help me with the following, hopefully simple, question? I have a table which I've connected to a dataset. I wish to add a new column to the beginning of the table and to fill...
6
by: Rudy | last post by:
Hi all, I know this is easy, just can't seem to get it. I have a windows form, and a text box, with a value already in it. I need to add that value to a table. It's just one value, so the entire...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.