473,384 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,384 software developers and data experts.

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

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
Nov 17 '05 #1
6 3281
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!
Nov 17 '05 #2
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!
Nov 17 '05 #3
Hello Natty,

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

Andreas

"Natty Gur" <na***@dao2com.com> schrieb im Newsbeitrag
news:uf**************@TK2MSFTNGP12.phx.gbl...
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!

Nov 17 '05 #4
Hello Natty,

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

Andreas

"Natty Gur" <na***@dao2com.com> schrieb im Newsbeitrag
news:uf**************@TK2MSFTNGP12.phx.gbl...
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!

Nov 17 '05 #5
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!
Nov 17 '05 #6
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!
Nov 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: 1111111111 | last post by:
Here is what I have so far... User is to enter 2 integers. One digit at a time. After that I have to print out what the user entered, and then add the two together. Example: Enter First Integer...
5
by: William Payne | last post by:
Hello, consider the following two classes (parent and child): #ifndef SINGLETON_HPP #define SINGLETON_HPP #include <cstddef> /* NULL */ template <typename T> class Singleton {
6
by: Alpha | last post by:
I have several textboxes that I need to chang the text when the selection row is changed in a datagrid. I have the following code. This textbox displayes the initial selection but when I click on...
0
by: Andreas Klemt | last post by:
Hello, I have this Public Structure strucUser Dim userIDAs Integer Dim firstnameAs String Dim lastname As String End Structure Dim collectUser As New Collection
3
by: Shapper | last post by:
Hello, How to I create add Div with an Asp:Label and an Asp:DropDownList inside it to my aspx page from my vb.net code? Thanks, Miguel
4
by: Rich | last post by:
Hello, I have a one datagrid that will be based on different datatables. One datatable may have 7 columns, another 15... With the tables that have more columns, I have been manually dragging...
1
by: Øyvind Isaksen | last post by:
I try to make my own ArticleAttribute object and ArticleAttributeCollection, and add data to this Collection. It almost works, but the problem is that each time I add an ArticleAttribute to my...
1
by: vishwaskothari | last post by:
hiiiii how can i bind a datagrid control to a recordsource through programming. TIA regards vishwas
12
by: vishwaskothari | last post by:
How i can bind the datagrid with the record that are present in a recordsource through programming? one more thing is that the no of record present in the recordsource may vary according the users...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.