Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I need to show some values which i got from Database in my grid as below,

Name ScoreMaths ScorePhysics
A 1 5
B 2 6
C 3 7
D 4 8

So i added new rows for each values in my data table and set the source of grid as data table.
But am getting out put as

Name ScoreMaths ScorePhysics
A 1
B 2
C 3
D 4
A 5
B 6
C 7
D 8

How can i solve this issue?
Please let me know if you need any more clarifications.
Posted
Comments
Am Gayathri 11-Mar-13 4:18am    
I need to show some values which i got from Database in my grid as below,

Name ScoreMaths ScorePhysics
A 1 5
B 2 6
C 3 7
D 4 8

So i added new rows for each values in my datatable and set the source of grid as datatable.
But am getting out put as

Name ScoreMaths ScorePhysics
A 1
B 2
C 3
D 4
A 5
B 6
C 7
D 8

How can i solve this issu?
Plese let me know if you need any more clarifications.
Per Söderlund 11-Mar-13 4:36am    
Do it with your database query?
I´m guessing you are using sql database.
If you do a query getting only the information you need, then you already have your DataTable right there.
Am Gayathri 11-Mar-13 5:10am    
In database i cant give it.This is just an example my table fields and values are different.

am using

dr[0] = xxx.value;
this will add rows but how to give which column it should add here?
Am Gayathri 11-Mar-13 5:20am    
Please help

1 solution

Use table.rows[<row>][<column>] while adding rows
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900