Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default DataSet to DataSet

    Hello,
    I'm trying to copy data from one DataSet to another DataSet. My
    question is, how do you access a column in a specific row. Similar to an
    array. Can you do that? I'm sure there is something basic I'm just not
    understanding.

    // Now fill temporary DataSet to be the DataSource.

    for(int i = firstNumberOfRecord; i <= lastNumberOfRecord; i++)

    {

    // Declare a Row object.

    DataRow newRow = m_dsAccountsCustom.Tables[0].NewRow();


    // Transfer values into the new columns.

    newRow[0] = m_dsAccounts.Tables[0].Column[0];

    newRow[1] = m_dsAccounts.Tables[0].Column[1];

    newRow[2] = m_dsAccounts.Tables[0].Column[2];

    newRow[3] = m_dsAccounts.Tables[0].Rows;

    newRow[4] = m_dsAccounts.Tables[0].Rows[i].Column[4];

    // Add the new row to the temporary DataSet.

    m_dsAccountsCustom.Tables[0].Rows.Add(newRow);

    }


    --
    Sincerely,
    Joseph D. DeJohn
    [url]http://www.geocities.com/cujdd5/[/url]


    Joseph D. DeJohn Guest

  2. Similar Questions and Discussions

    1. Dataset.length(), dataset.hasnext() not working.. Why?
      I have a dataset that has 3 items, yet when I test for it, it is "undefined". Any ideas why this property would not be available? Thanks Geoff
    2. help about dataset
      Hi, do you know why i got error on this: da = new SqlDataAdapter(); ds = new DataSet();
    3. dataset.Databind error when dataset XML contains attributes...
      I've come accross an interesting problem populating an asp.net datagrid. I am trying to bind XML data to a datagrid as I've done in countless other...
    4. Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset
      Hi All, I am facing problem in copying content of table from a untyped dataset into to a table inside the typed dataset. I wanted to copy the data...
    5. SQL and Dataset
      try MATCHES instead of LIKE "jayuya" <jayuya@cox.net> wrote in message news:017e01c35497$ad3d3390$a601280a@phx.gbl...
  3. #2

    Default DataSet to DataSet

    what about..

    m_dsAccounts.Tables[0].Rows[i][4];

    >-----Original Message-----
    >Hello,
    > I'm trying to copy data from one DataSet to
    another DataSet. My
    >question is, how do you access a column in a specific
    row. Similar to an
    >array. Can you do that? I'm sure there is something
    basic I'm just not
    >understanding.
    >
    >// Now fill temporary DataSet to be the DataSource.
    >
    >for(int i = firstNumberOfRecord; i <= lastNumberOfRecord;
    i++)
    >
    >{
    >
    >// Declare a Row object.
    >
    >DataRow newRow = m_dsAccountsCustom.Tables[0].NewRow();
    >
    >
    >// Transfer values into the new columns.
    >
    >newRow[0] = m_dsAccounts.Tables[0].Column[0];
    >
    >newRow[1] = m_dsAccounts.Tables[0].Column[1];
    >
    >newRow[2] = m_dsAccounts.Tables[0].Column[2];
    >
    >newRow[3] = m_dsAccounts.Tables[0].Rows;
    >
    >newRow[4] = m_dsAccounts.Tables[0].Rows[i].Column[4];
    >
    >// Add the new row to the temporary DataSet.
    >
    >m_dsAccountsCustom.Tables[0].Rows.Add(newRow);
    >
    >}
    >
    >
    >--
    >Sincerely,
    >Joseph D. DeJohn
    >[url]http://www.geocities.com/cujdd5/[/url]
    >
    >
    >.
    >
    Rory Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139