add data from multiple rows in table to one row in gridview

 heya is there any way of adding data from multiple rows in table to one row in gridview.

 

eg. ipc                 column 1 ,            2 ,                       3,                 4 

1,    11111                 33                    66                         44                 11

2,    11111                       44                   55                         8 8                  55

3,    11111                         55                     55                     66                  66

4,     11111                         66                      44                    44                    44

 

 i want to bring column 1 and 2 from rows 1 and 2 and place them like this

 ipc                 column 1 ,            2 ,                     row 2,  1,            2 

11111                 33                    66                                44           55

the problem is that there is over 4000 records that have in another table multiple rows of data associated with them. so i have a table that has the ipc(material number, unique) and i have another table called pour data where there are multiple ipc's that they want to pull certain data from certain lines and populate a gridview like above..

 thanks

0
pendo19
8/14/2008 3:43:32 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
908 Views

Similar Articles

[PageSpeed] 27

Hi pendo19 ,

I think you can simpliy use one sql query :

Select top 2 * from tablename

 



Samu Zhang
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
Samu
8/20/2008 2:21:39 AM
Reply:

Similar Artilces:

Add new controls to a gridview row; when editing that row using the edit row feature in the gridview control.
Hi all  I have a questions that looks hard / complex to me, and i know you can help me in this. Q {  I have row in a Gridview and i have an edit option to it. I press the edit button, to edit the values in that row and update data all the way back to the database. Now when i press the edit button, i want a drop down list to be displayed that contain values for a particular field in my grid view. (for now only plain text boxes appear.) } I hope you understand my question, all i need to do is replace the text box controls with a dropdown list when i am editing a row in ...

Data Controls insert rows into gridview then insert rows from gridview into SQL Table
Hello there, I'm still new at performing miracles with code . Currently I am having trouble with my latest coding adventure I have a web application which records jobs and labour assigned to jobs. The issue in particular I'm having is the way in which labour is to be assigned. I want to use standard controls (Textbox, Dropdownlist) to record the values into a gridview (ie,put multiple rows into the gridview using the controls). Then, when all the inserting is complete, the user clicks a submit button to insert all the rows from the gridview into a database table. The reason for...

Add row to table with table.row.add()
Everytime I click on a button I want to add a tableRow to a table like this:        TextBox TB = new TextBox();                TableCell Cell = new TableCell();        Cell.Controls.Add(TB);        TableRow Row = new TableRow();        Row.Cells.Add(Cell);        table.Rows.Add(Row);It works the first time, but when I click the button again the last r...

Display multiple table rows in a single Gridview row?
I have two tables:   transportreply |id| |submitby| |transport| 2008 |id| |liftclub| |liftclubsize| |workfromhome| |leave| |submitby| In the transportreply, there are multiple rows with information submitted by the same user originating from a checkboxlist.  What I need is an inner join of the two tables that display all the results on one Gridview row.  Currently my code looks like this: Results.aspx<table align="center" width="900" bgcolor="#E6E6E6" class="table3"><tr><td><div class="td4&q...

Multiple grid rows per Data row in GridView
I have a dataset that is binded to a gridview. The dataset has 5 fields and a description. I want to display 1 row for the 5 short fields and 1 row underneath it for the description. (per record)   For example: ID Name  Surname Field3 Field 4 1   John     Smith      blah    blah     This is the long description for  John Smith spanning 5 cells 2   Peter    Parker     blah    blah     This is t...

ADO.net problem: i can not view image data for the rest of my table rows except the image for the first row but i can read all the other non image fields for all rows.
Hi i have a table with the following fields imgid............int imgdata........image imgtitle.........varchar(max) imgType........varchar(max) imgLength.....bigint incident_id.....int i have no problem with uploading the image but viewing the uploaded image(s) in a gridview has caused me great pain. The probelm is i have two pages. page1 grabs the image to display and page2 has a gridview that displays the grabed image. I wanted to have an sql statement like SELECT * FROM mytable WHERE incident_id=someValue. IF i have 5 records in this table and i view page2 ...

Update a rows in one table for each row in other table
Hello all, i am a newbie in SQL and i want to ask for your help in order to do the following update statement. I have a table tblUsers which holds all the users, one of the fields in their GroupId. In the UserGroup table i have a field "UsersCount" and in that field i want to keep the number of the users in that group. Basically i want everytime i am saving a user to recalculate the users in all usergroups. I am trying to have something like:SELECT User_GroupId, count(User_GroupId) as UsersCount FROM tblUsersWHERE DeletedFlag = 0 GROUP BY User_GroupId and then:"FOR EACH" User_GroupIdUPDAT...

Can you display data from a single row in multiple rows using a GridView?
I am currently displaying 3 fields in a gridview and it looks something like this:First Name Last Name Age ======== ======== === Chris Messineo 40 John Smith 35 Tim Jones 30I need to modify the gridview and display a bio, but I want it to display on 1 full line below each line, like this:First Name Last Name Age ======== ======== === Chris Messineo 40 Chris was born in a log cabin... John Smith 35 At the age of 10 John invented... Tim Jones 30 Mr. Jones was always a curio...

Error with Gridview when i delete the row that have only one row in gridview
 Dear all, i develop with asp.net 2005 and use gridview and set enable deleteing =true. I can delete record in gridview properly but when gridveiw has only one row and then i'm clike delete button , the error occurs :   Server Error in '/it' Application. Specified argument was out of the range of valid values.Parameter name: value Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentOutOfRangeExce...

Gridview
Hi. What I would like to do is to have a layout like this ID Description SomeOthercolumn ----------------------------------------------------------------------------- ID Short description Text Some other value Long description Text that will span multiple columns ID #2 Short description Text #2 Some other value #2 Long description Text that will span multiple columns #2 Get the picture. This is not a problem with repeaters, because you ha...

Arranging data on multiple rows into a sigle row (converting rows into columns)
Hello, I have a survey (30 questions) application in a SQL server db. The application uses several relational tables. The results are arranged so that each answer is on a seperate row: user1   answer1user1   answer2user1   answer3user2   answer1user2   answer2user2   answer3 For statistical analysis I need to transfer the results to an Excel spreadsheet (for later use in SPSS). In the spreadsheet I need the results to appear so that each user will be on a single row with all of that user's answers on...

Displaying one of the columns in GridView data as GroupBy or similar data one after another row
Hi Would like to know the property or code that will Group data in one of the columns of GridView together. In other words i like to display the columns data in GridView that is repeated more than once together. Example: say Column heading Name John Jim Kevin Albert John Jim John You can see john or jim is displayed in Name Column at various rows. I like to get them displayed together such as John John Jim Jim Regards,-- "Mark As Answer" if my reply helped you -- Hi I am not too sure, but may be you can try a "Order by" clause at your SQL level. Say,...

how to add multiple rows in a data table against a button click event
how to add multiple rows in a data table against a button click event, and then show it in a gridviewmahmood http://www.vikramlakhotia.com/Inserting_multiple_records_using_one_stored_procedure.aspx  Vikram www.vikramlakhotia.comPlease mark the answer if it helped you Refer to this link. http://bytes.com/forum/thread524698.html Hope this helps.  Hi,Use the following code (VB.Net)   Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click 'Assign DataTable Dim dtTable As DataTable = Nothing ...

Can We add Data Rows To GridView With out Dataset ot Table
We can Add new rows to Grid dynamically in windows application by coding add new row(n) can we do like that in GridView or any other data provider? Presently I am adding Row only by genarating Dataset or Datatable can any one help me Anything that implements IDatasource (http://msdn2.microsoft.com/en-us/library/system.web.ui.idatasource.aspx) can be bound as the datasource for a databoundcontrol (http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.databoundcontrol.aspx).  I think you can even use a generic list of objects so long as their properties are availa...

Web resources about - add data from multiple rows in table to one row in gridview - asp.net.presentation-controls

Code division multiple access - Wikipedia, the free encyclopedia
Code division multiple access ( CDMA ) is a channel access method used by various radio communication technologies. It should not be confused ...

Jakarta attacks: Multiple bombs hit Indonesian capital
ISIS has claimed responsibility for the grenades and crude homemade bombs used to stage a Paris-style attack in a busy business and shopping ...

Jakarta attacks: seven dead in multiple attacks linked to Islamic State
Jakarta is on highest possible alert for terrorism, after multiple explosions hit Central Jakarta on Thursday.

Jakarta attacks: seven dead in multiple attacks linked to Islamic State
Seven people have been killed in a terrorist attack in central Jakarta, including five who are believed to be perpetrators linked to the Islamic ...

iOS 9.3 & watchOS 2.2 betas add ability to pair multiple Apple Watches with an iPhone
... sign that new Apple Watch hardware could be around the corner, Apple's newly released iOS 9.3 beta gives developers the ability to pair multiple ...

Multiple Jobholders Artificially Boost "Full-Time" Employment: Does the Sum of the Parts Equal the Whole ...
... pretty much confirms what I have said about Obamacare boosting part-time employment at the expense of full time jobs. Please consider Multiple ...

Google Seeks Multiple Auto Partners for Self-Driving Car Unit
Google hopes to form partnerships with many automakers and suppliers as it develops self-driving cars to reduce traffic accidents and expand ...

Multiple Explosions, Gunfire Rock Jakarta In Deadly ISIS-Claimed Attack
At least seven people died, including five assailants, a police spokeperson said. Multiple explosions and a gun battle rocked Jakarta, the capital ...

Ramon Foster: Multiple Bengals Spit On Steelers, Not Just Burfict
Steelers OL Ramon Foster joins The Fan Morning Show

The watchOS 2.2 beta lets devs pair multiple devices to one iPhone
... hands on the first beta for watchOS 2.2 today, and it reportedly contains a feature that has us a little confused: the ability to pair multiple ...

Resources last updated: 1/17/2016 1:14:56 PM