473,387 Members | 1,545 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.

Change/assign a value to dataset

Roy
Hi all,
Would anyone tell me how to change a value of a column in a dataset?
Something like this:

ds.Tables(0).Rows(0)("Column1") = 1

Tia,
Roy
Nov 21 '05 #1
3 12569
ds.Tables(0).Rows(0)(0) = 1
--
Scott Swigart - MVP
http://blog.swigartconsulting.com

"Roy" <Ro*@discussions.microsoft.com> wrote in message
news:07**********************************@microsof t.com...
Hi all,
Would anyone tell me how to change a value of a column in a dataset?
Something like this:

ds.Tables(0).Rows(0)("Column1") = 1

Tia,
Roy

Nov 21 '05 #2
Roy
Hi Scott,
But what happens if ds doesn't have any records in its table. How can I add
a blank row and then update the columns values with my default values?
Thanks again

"Scott Swigart [MVP]" wrote:
ds.Tables(0).Rows(0)(0) = 1
--
Scott Swigart - MVP
http://blog.swigartconsulting.com

"Roy" <Ro*@discussions.microsoft.com> wrote in message
news:07**********************************@microsof t.com...
Hi all,
Would anyone tell me how to change a value of a column in a dataset?
Something like this:

ds.Tables(0).Rows(0)("Column1") = 1

Tia,
Roy


Nov 21 '05 #3
Roy,

Strange I thought that I had sent you an answer.

ds.Tables(0).Rows(0)("Column1") = 1

It was like this.

This will set in the Item "Column1" from the first datarow from the first
Table when that is an integer field an 1.

Because that I saw your next question on which are probably hundred answers,
one of them.

\\\
ds.Tables(0).Rows.Add(ds.Tables(0).NewRow)
///

I hope this helps,

Cor
Nov 21 '05 #4

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

Similar topics

3
by: Varun | last post by:
How to assign a value to password field from dataset Thank yo Varun
3
by: Wilson Wu | last post by:
Hi, How can I find the field value in the dataset and then assign one of the field value to a variable ? Thanks Wilson
2
by: gjtired | last post by:
Currently I am retrieving values from a dataset and assigning the values to a textbox. I then assign the value from the textbox to a variable. I don't need the values in the textbox at all. I'm...
2
by: trint | last post by:
I have an app that I have been using this code to fill a datagrid: DataSet ds = new DataSet("Recordset"); OleDbDataAdapter da = new OleDbDataAdapter(); // Call data adapter's Fill method to...
2
by: Luis Esteban Valencia | last post by:
Hello I have a datagrid with a dropdownlist that has the products, another column has the price of the product and when the user changes the product it also must change the price how can I achieve...
6
by: Aaron Smith | last post by:
Ok. I have a dataset that has multiple tables in it. In one of the child tables, I have a column that I added to the DataSet (Not in the DataSource). This column does not need to be stored in the...
1
by: MasterChief | last post by:
I am sending a page a query string called job_id. What I want to do is take the job_id that is passed look it up in a database and make the text in a label on the new page display a value of one of...
4
by: Martin Arvidsson | last post by:
Hi! I have used the SqlCommand and DataReader to read data to a DataSet This dataset is the used to set the properties; DataMember and DataSource of the DataGridView. Now what i want to do is...
0
by: morathm | last post by:
I have a windows client database management application written in C# that connects to remote web services to do all the heavy work. The thin-client app uses strong typed datasets, all maintained at...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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,...

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.