Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > HowTo Bind a New Collection to my DataGrid? Please take a look to my little code...Thanks!!

Reply
Thread Tools

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

 
 
Andreas Klemt
Guest
Posts: n/a
 
      07-14-2003
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


 
Reply With Quote
 
 
 
 
Natty Gur
Guest
Posts: n/a
 
      07-14-2003
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!
 
Reply With Quote
 
 
 
 
Andreas Klemt
Guest
Posts: n/a
 
      07-14-2003
Hello Natty,

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

Andreas

"Natty Gur" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> 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!



 
Reply With Quote
 
Natty Gur
Guest
Posts: n/a
 
      07-14-2003
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!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
1 little 2 little 3 little Kennedys dale Digital Photography 0 03-23-2008 01:03 PM
Collection problems (create Collection object, add data to collection, bind collection to datagrid) Řyvind Isaksen ASP .Net 1 05-18-2007 09:24 AM
Please take a look at this project Jacob.Kofod@gmail.com ASP .Net 0 11-24-2005 04:48 PM
can someone please take a look at this(pretty basic) vamp4l Java 8 09-19-2005 12:05 AM
Please take a look!!!!! diego_passion@hotmail.com ASP .Net 0 12-04-2003 04:19 PM



Advertisments