Usman,

'ImportRow()' method can be used, but before that we must consider its
inner working. According to MSDN:

"Calling 'NewRow()' adds a row to the table using the existing table
schema, but with default values for the row, and sets the
'DataRowState' to 'Added'. Calling 'ImportRow()' preserves the
existing 'DataRowState' along with other values in the row. If the
'DataRow' that is passed as a parameter is in a detached state, it is
ignored, and no exception is thrown."

Therefore it depends on the requirement of OP whether he/she needs to
"add" or "import" rows.


On Nov 12, 4:58 pm, Usman <[EMAIL PROTECTED]> wrote:
> DataSet ds1=new DataSet();
> DataSet ds2=new DataSet();
>
> //copy a datarow from one dataset to another
> foreach(DataRow dr in ds1.Tables[0].rows)
> {
>    if(any condition)
>    {
>       ds2.Tables[0].ImportRow(r);
>    }
>
>
>
> }- Hide quoted text -
>
> - Show quoted text -

Reply via email to