How to create this dataset? Thank You.

Discussion in 'ASP .Net' started by Shapper, Jun 18, 2005.

  1. Shapper

    Shapper Guest

    Hello,

    I have a loop for where I want to add data to a dataset.
    I already created the dataset:

    Dim dsNews As DataSet = New DataSet()
    dsNews.Tables.Add
    dsNews.Tables(0).Columns.Add("title", GetType(String))
    dsNews.Tables(0).Columns.Add("description", GetType(String))

    How to create a new row in each For loop Step and assign it values?

    Something like:

    For i = 1 to 10
    NEW ROW
    Row.Title = ...
    Row.Description = ...
    End

    Thank You,
    Miguel
     
    Shapper, Jun 18, 2005
    #1
    1. Advertising

  2. Shapper

    chud Guest

    Dim row As DataRow = dsNews.Tables(0).NewRow()
    With row
    .Item("title") = "some title"
    .Item("description") = description
    End With
    dsNews.Tables(0).Add(row)
     
    chud, Jun 18, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miguel Dias Moura
    Replies:
    1
    Views:
    399
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Apr 1, 2004
  2. Miguel Dias Moura
    Replies:
    1
    Views:
    422
    Lars Netzel
    Jun 18, 2004
  3. Shapper
    Replies:
    1
    Views:
    449
    Shapper
    Apr 21, 2005
  4. Shapper
    Replies:
    2
    Views:
    571
    Shapper
    Apr 22, 2005
  5. Shapper
    Replies:
    4
    Views:
    366
    =?Utf-8?B?UHJha2FzaC5ORVQ=?=
    Jun 15, 2005
Loading...

Share This Page