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:

Data keys must be specified on GridView
'classlistView' before the selected data keys can be retrieved.
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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.