To get the list of data from DB and to alter the grid struct by inserting a new col?

JCel

Active member
Joined
Jun 15, 2009
Messages
30
Programming Experience
Beginner
Hi there,

In my windows application I use a database table STUDENT which contains id and names of the students as its fields.

Now i want to enter the students TEST1 MARKS in the following way:

i.e. I should get the students data in some order (may be one after the other like a list) in datagrid or in some appropriate controls,

The actual problem is I should create a column dynamically as TEST! and in this field I should enter the student marks..
eg. If i type 3 in ID field, the cursor should move to the student data with ID 3 and I should enter his marks...

Is it possible in VB.Net if not give me some other approx. solution to solve!

Regards,
JCel.
 
Absolutely you can add columns dynamically but I'm wondering if you really need too or not. Why not create the column you know you need in your table now and just leave them blank/null; and then pull all the data back when needed and edit the records at that time.

Also is one column really enough? You may want to create additional tables, one for your students and then linked to another table that holds test grades which you can input each and every test & score.
 
Why not create the column you know you need in your table now and just leave them blank/null;

Here in my application i dont know how many assessments the faculties may conduct bcoz as per the schedule there may be only 4-5 Assessments, but in reality the faculties may conduct 7-8 class tests. so to store all tests marks i need to create a column dynamically as and then when needed.

is one column really enough? You may want to create additional tables, one for your students and then linked to another table that holds test grades which you can input each and every test & score.

One column is not enough... just for an example i said like that...

So now could you please tell me how to acheive it?
 
Well I wouldnt suggest creating a new column for every test. Instead (simply put) you could create a table named tblTests. The columns could be; class or class id, student id, test name, test score and whatever other fileds of info you may need. Then it doesnt matter how many tests they have, you can just create a new record in the table for each test. The tests can be linked to the student table. So when you select a student (or class) it would return all the asscoiated test records.
 
Hi Tom,

What you have said can be implemented to view the students Test performance. But to insert the marks i need the list of students to be showed and in that list I should enter their corres. marks.



i.e if i enter that student id in the first cell i should get the other fields and in the same row i should enter His marks...
 
Hi there,

Is there any possibility of getting data like the above (Similar to the insertion in Access in which we can add fields dynamically)

If not,Please tell me some other alternate solution to obtain it...

Regards,
JCel
 
Back
Top