473,387 Members | 1,575 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,387 software developers and data experts.

New Column to DataSet.DataTable

Hi,
I am making a query to a database, that is returning a DataSet. The
DataSet contains one table, columns and rows of data.

Now, for that same table, I need to add a new column(Column New).
This new column will contain data retrieved from the same table and
have some functionality applied to it. New Column is to be kept
locally, and datasource is not to be updated.

How can I do this? Should I create a new dataset?

******* Table ******
Column x Column New
5 func(5)
6 func(6)
.....
I hope someone understands my problem and can help me out.
Thanks in Advance
Nov 17 '05 #1
4 9709
Xarky,

In fact are it two questions.
The first is easy to answer with this link
http://msdn.microsoft.com/library/de...ctortopic4.asp

When you mean with the datasource the database, than it is easy to answer,
the update does only those columns which are in the update commands (insert,
update) from the dataadapter or whatever.

When you mean a datasource for a datagrid or whatever than you have in my
opinon to tell that to get a good answer, and than as well as it is a
datagrid if it is web or windowforms.

I hope this helps,

Cor
Nov 17 '05 #2
Hi,
I was not clear in my query. What I wanted to write is the following:

I need to retrieve data from a database. The DataSet returned needs to
be manipulated(my previous query, create a new dataSet, or if possible
add a newColumn to it) and the the new DataSet is to act as a datasource
to a datagrid in my webform.

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3
Xarky,
I was not clear in my query. What I wanted to write is the following:

I need to retrieve data from a database. The DataSet returned needs to
be manipulated(my previous query, create a new dataSet, or if possible
add a newColumn to it) and the the new DataSet is to act as a datasource
to a datagrid in my webform.

See the link I gave, normally you can use your original datatable by the
way.

I hope this helps,

Cor
Nov 17 '05 #4
Thanks for your help. I used the original table, created a new column
in it, and then looped through all the rows to create data wanted.

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #5

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

Similar topics

3
by: André Almeida Maldonado | last post by:
When I use this code: Dim dtsDataSet As DataSet = New DataSet("Dados") Dim dttUsuarios As DataTable = dtsDataSet.Tables.Add("Usuarios") Dim dtvUsuarios As DataView = New...
1
by: Juan | last post by:
I built a form that displays a master-detail relation ship, now i need to add a column to the datagrid displaying the master data, this column corresponds to the text name of a column stored in the...
2
by: Joe | last post by:
Hi All, I am new to using the Access DB and I need some help if someone is able to give it to me. What I want to do is get the names of the columns of certain tables. Not the data in the table...
24
by: Mike L | last post by:
This is for a Win form, in C# 2005. I want to load a datagrid, make some columns width 0, and then clean out the record I added. I get the error message, ""Index was out of range. Must be...
6
by: Hutty | last post by:
I've looked around and have yet to find anything that would answer my question regarding formating a column in a datagrid. My grid looks like this as far as data" AMHQCON|51300.01|-3147 The...
7
by: Patrick Olurotimi Ige | last post by:
I have a simple Stored Procedure with multiple select statements..doing select * from links for example. I created a DataTable and then fill the tables But the first dtTemplate DataTable doesn't...
3
by: jason | last post by:
I'll try to explain in detail what it is I'm struggling with. I created a SQL database with one table called CallSheet which contains the following columns: Caller ID: <--Primary Key, auto...
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...
1
by: Larry Bird | last post by:
I've created a AlertDataClass below within the class I have tables and column that I've create. In the AlertDataAccess class I'm trying to insert data into my tables. AlertDataAccess is a Module...
3
by: =?Utf-8?B?UmljaCBIdXRjaGlucw==?= | last post by:
I'm not really sure how to ask this question because I'm still getting my feet wet with data access and VB.NET, but here goes: To start off with, I'm using VB 2005 Express to connect to an Access...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.