Hi All,

I've got a strongly typed DataSet where I want to: traverse the rows in a
table and do a check. If the check is successful, I want to duplicate the
row, tweak a column, then add it to the same table in the DataSet.

What's the most efficient way to do this?

I tried to 'new' a new DataSet-derived DataRow (and hoping to copy a row
into it), but the constructor wanted a DataRowBuilder, which i don't have.
DataRowBuilder appears to be an internal object, not useable by us
developers.

Also, the table has 34 columns and it's a pain in the rear to write all the
code to deal with the DataRow indexes. Is there a better (less typing) way
to do the copy, or do I have to deal with the base DataSet class
exclusively?

Thanks in advance!
Corey.

Re: duplicating a DataRow by Miha

Miha
Fri Jun 18 15:42:02 CDT 2004

Hi Corey,

Did you try with DataTable.ImportRow?

-
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"Corey Wirun" <corey.wirun@nospam.ca> wrote in message
news:naEAc.459$T_1.207@clgrps12...
> Hi All,
>
> I've got a strongly typed DataSet where I want to: traverse the rows in a
> table and do a check. If the check is successful, I want to duplicate the
> row, tweak a column, then add it to the same table in the DataSet.
>
> What's the most efficient way to do this?
>
> I tried to 'new' a new DataSet-derived DataRow (and hoping to copy a row
> into it), but the constructor wanted a DataRowBuilder, which i don't have.
> DataRowBuilder appears to be an internal object, not useable by us
> developers.
>
> Also, the table has 34 columns and it's a pain in the rear to write all
the
> code to deal with the DataRow indexes. Is there a better (less typing)
way
> to do the copy, or do I have to deal with the base DataSet class
> exclusively?
>
> Thanks in advance!
> Corey.
>
>



Re: duplicating a DataRow by v-schang

v-schang
Sat Jun 19 01:02:47 CDT 2004

Hi Corey,

I think Hiha's suggestion that use the DataTable's importRow method is
reasonable and here are some former threads discussing the same problem,
you can also have a look:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=eE6ZPscLEHA.2660%
40TK2MSFTNGP09.phx.gbl&rnum=5&prev=/groups%3Fq%3DDataTable%2Bcopy%2Brow%26ie
%3DUTF-8%26hl%3Den

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=cmb5av0vlvqom4906
fp7qnmi7o5b1vv796%404ax.com&rnum=8&prev=/groups%3Fq%3DDataTable%2Bcopy%2Brow
%26ie%3DUTF-8%26hl%3Den

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=%238787rueDHA.361
6%40TK2MSFTNGP11.phx.gbl&rnum=3&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%
26q%3DDataTable%2Bcopy%2Bdatarow


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx



Re: duplicating a DataRow by Miha

Miha
Sat Jun 19 03:31:03 CDT 2004


"Steven Cheng[MSFT]" <v-schang@online.microsoft.com> wrote in message
news:xbs3TMcVEHA.2980@cpmsftngxa10.phx.gbl...
> Hi Corey,
>
> I think *Hiha's* suggestion ...

:-)

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com



OT by Cor

Cor
Sat Jun 19 04:10:33 CDT 2004

LOL
> >
> > I think *Hiha's* suggestion ...
>
> :-)
>



Re: duplicating a DataRow by Corey

Corey
Mon Jun 21 10:17:17 CDT 2004

I'll try what you suggested.

Thanks, 'Hiha', err, I mean Miha. ;)

Corey.

"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:OQ%23b3SXVEHA.2336@TK2MSFTNGP12.phx.gbl...
> Hi Corey,
>
> Did you try with DataTable.ImportRow?
>
> -
> Miha Markic [MVP C#] - RightHand .NET consulting & development
> miha at rthand com
> www.rthand.com
>
> "Corey Wirun" <corey.wirun@nospam.ca> wrote in message
> news:naEAc.459$T_1.207@clgrps12...
> > Hi All,
> >
> > I've got a strongly typed DataSet where I want to: traverse the rows in
a
> > table and do a check. If the check is successful, I want to duplicate
the
> > row, tweak a column, then add it to the same table in the DataSet.
> >
> > What's the most efficient way to do this?
> >
> > I tried to 'new' a new DataSet-derived DataRow (and hoping to copy a row
> > into it), but the constructor wanted a DataRowBuilder, which i don't
have.
> > DataRowBuilder appears to be an internal object, not useable by us
> > developers.
> >
> > Also, the table has 34 columns and it's a pain in the rear to write all
> the
> > code to deal with the DataRow indexes. Is there a better (less typing)
> way
> > to do the copy, or do I have to deal with the base DataSet class
> > exclusively?
> >
> > Thanks in advance!
> > Corey.
> >
> >
>
>



Re: duplicating a DataRow by yhhuang

yhhuang
Tue Jun 22 03:24:50 CDT 2004


;P I saw it too. Sorry for the typing error.

Enjoy the community.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.