HowTo Bind a New Collection to my DataGrid? Please take a look to my little code...Thanks!!

Discussion in 'ASP .Net' started by Andreas Klemt, Jul 14, 2003.

  1. Hello,
    I have this

    Public Structure strucUser
    Dim userIDAs Integer
    Dim firstnameAs String
    Dim lastname As String
    End Structure

    Dim collectUser As New Collection
    Dim strucUser As strucUser
    strucUser .userIDAs = rateID
    strucUser .firstnameAs = "Peter"
    strucUser .lastname = "Bond"
    collectUser .Add(strucUser )

    myDatagrid.DataSource = collectRate <<<---- ERROR !!!
    myDatagrid.DataBind()


    Error Message:
    DataGrid with id '' could not automatically generate any columns from the
    selected data source

    What is wrong?

    Thanks for any help,
    Andreas
    Andreas Klemt, Jul 14, 2003
    #1
    1. Advertising

  2. Andreas Klemt

    Natty Gur Guest

    Hi,

    1) where collectRate come from ?
    2)

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur, Jul 14, 2003
    #2
    1. Advertising

  3. Hello Natty,

    sorry, this was collectUser
    But it still doesn't work.
    Can you help me?

    Andreas

    "Natty Gur" <> schrieb im Newsbeitrag
    news:...
    > Hi,
    >
    > 1) where collectRate come from ?
    > 2)
    >
    > Natty Gur, CTO
    > Dao2Com Ltd.
    > 28th Baruch Hirsch st. Bnei-Brak
    > Israel , 51114
    >
    > Phone Numbers:
    > Office: +972-(0)3-5786668
    > Fax: +972-(0)3-5703475
    > Mobile: +972-(0)58-888377
    >
    > Know the overall picture
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Andreas Klemt, Jul 14, 2003
    #3
  4. Andreas Klemt

    Natty Gur Guest

    OK,

    "Use the DataSource property to specify the source of values to bind to
    a data listing control. The data source must be an object that
    implements the System.Collections.IEnumerable interface (such as
    System.Data.DataView, System.Collections.ArrayList, and
    System.Collections.Hashtable) to bind to a control derived from the
    BaseDataList class." - MSDN

    VB collection dosent Implement one of them. consider using one of the
    system.collection classes.



    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur, Jul 14, 2003
    #4
    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. Please take a look!!!!!

    , Dec 4, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    407
  2. Replies:
    0
    Views:
    364
  3. BORG
    Replies:
    12
    Views:
    561
  4. Øyvind Isaksen
    Replies:
    1
    Views:
    946
    Øyvind Isaksen
    May 18, 2007
  5. piapia
    Replies:
    0
    Views:
    533
    piapia
    Sep 23, 2008
Loading...

Share This Page