944,061 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 7791
  • VB.NET RSS
Feb 21st, 2006
0

Help Using Selected Values between Tables

Expand Post »
Hello everyone. I have a pretty straight foreward problem. Here is an overview of what i am trying to accomplish
1. I am trying to allow "teachers" of my quiz site to create a class list and in that class list, they can have a list of students. I created two tables, one called class list, and the other student list

2. On my page, I have two gridviews and two sql sources. the one sql source retreives the data from the class list table, and limits the results to a where statement based on a session object. The second sql data source grabs the data from the student list

3. I want the teacher to be able to click a class period from the table that is displaying the class list and have the student list data table display the list of students that are in that class period.

My problem: I restriced the sql source that is getting the student list to only show the data based on the selected value of the class list view. However, when i run the program, i get an error that says:

VB.NET Syntax (Toggle Plain Text)
  1. Data keys must be specified on GridView
  2. 'classlistView' before the selected data keys can be retrieved.
  3. Use the DataKeyNames property to specify data keys.

I think that this means i need to create a primary key. However, because multiple teachers are using the program, and each will have the same class period number, i cannot have the class period colum in my table be the primary key.

If this is kind of confusing, please let me know, and i will clarify. Thank you for all of your help!!! :p
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Mikecool509 is offline Offline
21 posts
since Jan 2006
Feb 22nd, 2006
0

Re: Help Using Selected Values between Tables

maybe what is happening is that on the initial load, you have nothing selected in the list of classes, so when your second grid tries to load based on the the selected object in the first gridview, it isn't working
Reputation Points: 14
Solved Threads: 19
Posting Pro in Training
campkev is offline Offline
484 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Need a VB DLL to call from BCBuilder++
Next Thread in VB.NET Forum Timeline: my code doest work





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC