Hello:

How can you you edit data in a datatable? I already have the datatables
created. I want to know how i can refer to the columns in the data table and
what commands do i have for editing info in the table. I want to be able to
move the values in one column to another in the same table

Thanks
Prasun

RE: Editing Info in a DataTable by Papa

Papa
Mon Apr 04 16:47:07 CDT 2005

If I understand you correctly ... To edit a value in a column in a DataTable,
follow this pattern:

int [iRowNum] = 0;
oMyDt[iRowNum]["Age"].Value = 7;

or to copy a column value form one column to another, do this:

int [iRowNum] = 0;
oMyDt[iRowNum]["FirstName"].Value = oMyDt[iRowNum]["Nickname"].Value;


-- John Papa
http://codebetter.com/blogs/john.papa

"Prasun" wrote:

> Hello:
>
> How can you you edit data in a datatable? I already have the datatables
> created. I want to know how i can refer to the columns in the data table and
> what commands do i have for editing info in the table. I want to be able to
> move the values in one column to another in the same table
>
> Thanks
> Prasun
>
>
>

Re: Editing Info in a DataTable by Prasun

Prasun
Mon Apr 04 16:59:03 CDT 2005

Thank You for the help...
Will this work in VB.NET. I will try and see

Thank You
Prasun

"Papa" <Papa@discussions.microsoft.com> wrote in message
news:3C40FA5B-BFCF-40BD-AC4C-0CF9522CB217@microsoft.com...
> If I understand you correctly ... To edit a value in a column in a
> DataTable,
> follow this pattern:
>
> int [iRowNum] = 0;
> oMyDt[iRowNum]["Age"].Value = 7;
>
> or to copy a column value form one column to another, do this:
>
> int [iRowNum] = 0;
> oMyDt[iRowNum]["FirstName"].Value = oMyDt[iRowNum]["Nickname"].Value;
>
>
> -- John Papa
> http://codebetter.com/blogs/john.papa
>
> "Prasun" wrote:
>
>> Hello:
>>
>> How can you you edit data in a datatable? I already have the datatables
>> created. I want to know how i can refer to the columns in the data table
>> and
>> what commands do i have for editing info in the table. I want to be able
>> to
>> move the values in one column to another in the same table
>>
>> Thanks
>> Prasun
>>
>>
>>



Re: Editing Info in a DataTable by Prasun

Prasun
Mon Apr 04 17:15:28 CDT 2005

Hmmm,
Ican't seem to adjust the code for VB.NET. I am a beginner. Could i get
help with the VB.NET syntax for this code

Thank You
Prasun

"Prasun" <prasunp_@csufresno.edu> wrote in message
news:eiLlEGWOFHA.2132@TK2MSFTNGP14.phx.gbl...
> Thank You for the help...
> Will this work in VB.NET. I will try and see
>
> Thank You
> Prasun
>
> "Papa" <Papa@discussions.microsoft.com> wrote in message
> news:3C40FA5B-BFCF-40BD-AC4C-0CF9522CB217@microsoft.com...
>> If I understand you correctly ... To edit a value in a column in a
>> DataTable,
>> follow this pattern:
>>
>> int [iRowNum] = 0;
>> oMyDt[iRowNum]["Age"].Value = 7;
>>
>> or to copy a column value form one column to another, do this:
>>
>> int [iRowNum] = 0;
>> oMyDt[iRowNum]["FirstName"].Value = oMyDt[iRowNum]["Nickname"].Value;
>>
>>
>> -- John Papa
>> http://codebetter.com/blogs/john.papa
>>
>> "Prasun" wrote:
>>
>>> Hello:
>>>
>>> How can you you edit data in a datatable? I already have the datatables
>>> created. I want to know how i can refer to the columns in the data table
>>> and
>>> what commands do i have for editing info in the table. I want to be able
>>> to
>>> move the values in one column to another in the same table
>>>
>>> Thanks
>>> Prasun
>>>
>>>
>>>
>
>



Re: Editing Info in a DataTable by Papa

Papa
Mon Apr 04 17:49:02 CDT 2005

Sure.

oMyDt(iRowNum)("Age") = 7

or to copy a column value form one column to another, do this:

Dim iRowNum as Int = 7
oMyDt(iRowNum)("FirstName") = oMyDt(iRowNum)("Nickname")


... Just noticed, I had a typo in the C# code. There is no value property.
sorry ;-)


-- John Papa
http://codebetter.com/blogs/john.papa


"Prasun" wrote:

> Hmmm,
> Ican't seem to adjust the code for VB.NET. I am a beginner. Could i get
> help with the VB.NET syntax for this code
>
> Thank You
> Prasun
>
> "Prasun" <prasunp_@csufresno.edu> wrote in message
> news:eiLlEGWOFHA.2132@TK2MSFTNGP14.phx.gbl...
> > Thank You for the help...
> > Will this work in VB.NET. I will try and see
> >
> > Thank You
> > Prasun
> >
> > "Papa" <Papa@discussions.microsoft.com> wrote in message
> > news:3C40FA5B-BFCF-40BD-AC4C-0CF9522CB217@microsoft.com...
> >> If I understand you correctly ... To edit a value in a column in a
> >> DataTable,
> >> follow this pattern:
> >>
> >> int [iRowNum] = 0;
> >> oMyDt[iRowNum]["Age"].Value = 7;
> >>
> >> or to copy a column value form one column to another, do this:
> >>
> >> int [iRowNum] = 0;
> >> oMyDt[iRowNum]["FirstName"].Value = oMyDt[iRowNum]["Nickname"].Value;
> >>
> >>
> >> -- John Papa
> >> http://codebetter.com/blogs/john.papa
> >>
> >> "Prasun" wrote:
> >>
> >>> Hello:
> >>>
> >>> How can you you edit data in a datatable? I already have the datatables
> >>> created. I want to know how i can refer to the columns in the data table
> >>> and
> >>> what commands do i have for editing info in the table. I want to be able
> >>> to
> >>> move the values in one column to another in the same table
> >>>
> >>> Thanks
> >>> Prasun
> >>>
> >>>
> >>>
> >
> >
>
>
>

Re: Editing Info in a DataTable by Prasun

Prasun
Mon Apr 04 18:36:21 CDT 2005

Thank You. Much appreciated

"Papa" <Papa@discussions.microsoft.com> wrote in message
news:88E8E9DF-5700-4EEF-A22A-77790E235135@microsoft.com...
> Sure.
>
> oMyDt(iRowNum)("Age") = 7
>
> or to copy a column value form one column to another, do this:
>
> Dim iRowNum as Int = 7
> oMyDt(iRowNum)("FirstName") = oMyDt(iRowNum)("Nickname")
>
>
> ... Just noticed, I had a typo in the C# code. There is no value property.
> sorry ;-)
>
>
> -- John Papa
> http://codebetter.com/blogs/john.papa
>
>
> "Prasun" wrote:
>
>> Hmmm,
>> Ican't seem to adjust the code for VB.NET. I am a beginner. Could i get
>> help with the VB.NET syntax for this code
>>
>> Thank You
>> Prasun
>>
>> "Prasun" <prasunp_@csufresno.edu> wrote in message
>> news:eiLlEGWOFHA.2132@TK2MSFTNGP14.phx.gbl...
>> > Thank You for the help...
>> > Will this work in VB.NET. I will try and see
>> >
>> > Thank You
>> > Prasun
>> >
>> > "Papa" <Papa@discussions.microsoft.com> wrote in message
>> > news:3C40FA5B-BFCF-40BD-AC4C-0CF9522CB217@microsoft.com...
>> >> If I understand you correctly ... To edit a value in a column in a
>> >> DataTable,
>> >> follow this pattern:
>> >>
>> >> int [iRowNum] = 0;
>> >> oMyDt[iRowNum]["Age"].Value = 7;
>> >>
>> >> or to copy a column value form one column to another, do this:
>> >>
>> >> int [iRowNum] = 0;
>> >> oMyDt[iRowNum]["FirstName"].Value = oMyDt[iRowNum]["Nickname"].Value;
>> >>
>> >>
>> >> -- John Papa
>> >> http://codebetter.com/blogs/john.papa
>> >>
>> >> "Prasun" wrote:
>> >>
>> >>> Hello:
>> >>>
>> >>> How can you you edit data in a datatable? I already have the
>> >>> datatables
>> >>> created. I want to know how i can refer to the columns in the data
>> >>> table
>> >>> and
>> >>> what commands do i have for editing info in the table. I want to be
>> >>> able
>> >>> to
>> >>> move the values in one column to another in the same table
>> >>>
>> >>> Thanks
>> >>> Prasun
>> >>>
>> >>>
>> >>>
>> >
>> >
>>
>>
>>