Home All Groups Group Topic Archive Search About

Change/assign a value to dataset

Author
8 Apr 2005 2:27 PM
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

Author
8 Apr 2005 3:03 PM
Scott Swigart [MVP]
ds.Tables(0).Rows(0)(0) = 1


--
Scott Swigart - MVP
http://blog.swigartconsulting.com

Show quoteHide quote
"Roy" <R**@discussions.microsoft.com> wrote in message
news:0713F209-B628-4405-A5B3-9080D552A602@microsoft.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
Author
8 Apr 2005 3:19 PM
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

Show quoteHide quote
"Scott Swigart [MVP]" wrote:

> ds.Tables(0).Rows(0)(0) = 1
>
>
> --
> Scott Swigart - MVP
> http://blog.swigartconsulting.com
>
> "Roy" <R**@discussions.microsoft.com> wrote in message
> news:0713F209-B628-4405-A5B3-9080D552A602@microsoft.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
>
>
>
Author
8 Apr 2005 3:41 PM
Cor Ligthert
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