Click here to Skip to main content
12,253,371 members (52,151 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: .NET1.0 .NET2.0 .NET3.0 C#3.0 , +
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 10-Mar-13 22:18pm
Comments
Kavitha le 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.
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.
Kavitha le 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?
Kavitha le 11-Mar-13 5:20am
   
Please help

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Use table.rows[][] while adding rows
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160426.1 | Last Updated 11 Mar 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100