ADO.NET :: Convert Rows To Column?
Feb 1, 2011
I have a datatable which contains rows for empid this is how the data looks empid year status category
1 2010 y 1
1 2010 y 2
2 2011 n 1
3 2010 y 2
i would like to make the data in the following format
1 2010 y 1 2
2 2011 n 1 0
3 2010 y 0 2
View 6 Replies
Similar Messages:
Apr 27, 2016
I saw post [URL] .... which is converting rows into column item,quantity ,price. I have one other image field .how can bind image in this program?
View 1 Replies
Jul 14, 2010
I have a gridview with 3 columns. In second column I want to display some text in 2 rows and then a gridview.
Here is my code:
[Code]....
The problem is my third row is displayed as a row under first column. How do I make it a separate column in my girdview. Not sure what is going wrong.
View 11 Replies
Mar 4, 2011
I'm binding a gridview from a webservice with 30 columns and 10 rows, I need to print the same in a PORTRAIT, for that i decided to display columns as rows and
rows as columns like below:
EMP1 1 2 3 4
EMP2 1 2 3 4
View 3 Replies
Jan 13, 2010
I have a table like this..
---------------------------------------------------
ItemID ItemName Qty CenterID
---------------------------------------------------
1 X 10 52
1 X 6 53
1 X 4 57
2 y 6 58
I SHOULD convert the abouve table like this..
ItemID ItemName Qty CenterA centerB CenterC CenterD
---------------------------------------------------
1 X 20 10 6 4 0
2 Y 6 0 0 0 6
View 4 Replies
Jul 15, 2010
I have a grid in dataset as following
UserPatientStatusID RelevantPeriod TotalCount ProviderSpecialtyServiceName
a OUT November2008 1 Not Available
a ER September2008 1986 Not Available
a ER April2009 1837 Not Available
a ER December2009 2367 Not Available
a ER August2008 1908 Not Available
b ER February2009 1598 Not Available
b ER January2009 1972 Not Available
b ER June2009 2087 Not Available
b ER December2008 2012 Not Available
b ER November2009 2148 Not Available
b ER November2008 2030 Not Available
c ER October2009 2240 Not Available
c ER September2009 2029 Not Available
c ER October2008 2079 Not Available
c ER July2010 1714 Not Available
c ER August2009 2115 Not Available
c OUT July2010 2 Not Available
c ER March2010 1755 Not Available
c ER May2010 1759 Not Available
c ER July2009 2063 Not Available
c OUT April2009 1 Not Available
c OUT December2008 1 Not Available
c ER March2009 1931 Not Available
c REC August2009 1 Not Available
I know that there can be 24 relevant periods for each user. There may or may not be all 24 present for each user.
Now all that 24 periods I have in an array in C#. I know what these periods will be. They change so I cannot hardcode it. It has to be dynamic.
I want to create 24 columns of that rows for relevant periods and display TotalCount in that and get all other data accordingly in c#.
View 6 Replies
May 27, 2010
I would like to be able to bulk edit all the rows for one column using a GridView control. What is the best way to do this?
View 3 Replies
Nov 17, 2010
All I am trying to do is query the database, then get the returned values, so that I can do some calculations. But, I don't understand how to get the values from the database row that is returned, so that I can assign it for usage.
I would like to do something where the logic goes: for the index of [1] (which is just column 1), multiply it by 2. For the index of [2] (which is just column 2), multiply it by 3.
Example below:
This does NOT work:
[Code]....
View 6 Replies
Nov 22, 2010
Its like I have multiselect option in Jqgrid in which i want to pass the selected rows value to the server and based on the value i will delete the rows. I dont want to have the ids to do my work. For the Single row i get the cell value and delete using the same. But for multi select its not the case. In getGridParam('selarrrow'); I use this to fetch the selected rows bu the values are not getting populated.
When i use the following code as i saw in some sample question i can fetch the value for the single row selection but when i select multiple rows then i pass it says like "FALSE" or "UNDEFINED". What can be the issue. var grid = jQuery('#list'); var sel_id = grid.jqGrid('getGridParam', 'selarrrow'); var myCellData = grid.jqGrid('getCell', sel_id, 'CountryId');
View 1 Replies
Jan 19, 2011
I am writing an SQL query in which that I will need to perform a sub select on a table, which will usually return multiple rows. I need to be able to join together the results of a certain field from all the rows into one field to output. Is this possible, and how?
For example, if the SQL query returns
id | field
1 | test1
2 | test2
3 | test3
I need the outputted field to be "test1 test2 test3".
View 4 Replies
Nov 21, 2010
I have a table with 2905 rows. I want to update one column with 2905 values. The values are all different, and they are just stacked one to a line with a line break. One on top of the other like so:
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
http://www.cargoarrainger.com/page6.html
http://www.iceretail.com/resources/link-7953
NULL
NULL
How would I write this query? Do they have to all be separated by commas? What about NULLS?
update tblAdvanceLinkBanned set ReciprocalURL=?
View 7 Replies
Jul 28, 2010
is there a way to update a column for all rows in a collection using linq like sql does it
eg. UPDATE myTable SET myColumn='newValue'
Also weighing options as to whether there is better performance using linq to sql for this or straight sql to DB via table adapters etc.
View 2 Replies
Mar 2, 2011
i have a salary table that have data like this ID EmpNo mYear Net Salary 29 3 January 2010 29217 1210 3 February 2010 29217 2052 3 March 2010 29217 3102 3 April 2010 29447 4153 3 May 2010 29447 6376 3 July 2010 28803 7231 3 August 2010 28281 7893 3 September 2010 29303 5207 3 June 2010 29197 8874 3 October 2010 29303 10076 3 November 2010 31276 11318 3 December 2010 31216 12503 3 January 2011 31266 13880 3 February 2011 31266 13414 1613 January 2011 19445 12043 1613 December 2010 19445 10563 1613 November 2010 19445 9364 1613 October 2010 18150 6163 1613 June 2010 10075 8433 1613 September 2010 18150 5154 1613 May 2010 18806 But i want to create a view like this ID EmpNo ThisMonth Previous Month mYear ThisNetSalary PreviousNetSalary Net Salary 29 3 January 2010 December 2009 January 2010 29217 0 29217 1210 3 February 2010 January 2010 February 2010 29217 29217 29217 2052 3 March 2010 February 2010 March 2010 29217 29217 29217 3102 3 April 2010 March 2010 April 2010 29447 29217 29447 4153 3 May 2010 April 2010 May 2010 29447 29447 29447 5207 3 June 2010 May 2010 June 2010 29197 29447 29197 6376 3 July 2010 June 2010 July 2010 28803 29197 28803 7231 3 August 2010 July 2010 August 2010 28281 28803 28281 7893 3 September 2010 August 2010 September 2010 29303 28281 29303 8874 3 October 2010 September 2010 October 2010 29303 29303 29303 10076 3 November 2010 October 2010 November 2010 31276 29303 31276 11318 3 December 2010 November 2010 December 2010 31216 31276 31216 12503 3 January 2011 December 2010 January 2011 31266 31216 31266 13880 3 February 2011 January 2011 February 2011 31266 31266 31266 13881 3 March 2011 February 2011 March 2011 0 31266 0 5154 1613 May 2010 April 2010 May 2010 18806 0 18806 6163 1613 June 2010 May 2010 June 2010 10075 18806 10075 8433 1613 September 2010 August 2010 September 2010 18150 10075 18150 9364 1613 October 2010 September 2010 October 2010 18150 18150 18150 10563 1613 November 2010 October 2010 November 2010 19445 18150 19445 12043 1613 December 2010 November 2010 December 2010 19445 19445 19445 13414 1613 January 2011 December 2010 January 2011 19445 19445 19445 13415 1613 February 2011 January 2011 February 2011 0 19445 0.
View 4 Replies
Oct 19, 2010
note MONTH AND DATES stored in single or double digits as they occur. Unfortunately DATE TIME is stored in NVARCHAR Data type column as 2/9/2010, 22/10/2010 etc. Following UK Date here. It is required to pull the data to COUNT No. of Expired. Obviously below one fails.
[Code]....
View 7 Replies
Mar 22, 2010
i want to sort my Gridview rows by a template column that is not bound to any database field. This template coulmn just has a label whose text i set in code depending on a value in a different column that is databound. So am stuck on how to set its sortExpression since its not linked to an column.
View 1 Replies
Jul 1, 2010
I currently have a datasource that displays several rows on an editable gridview where the user can update several rows at once. Each row contains an ActivityTotal column per row. I'd like to sum all the ActivityTotal rows displayed and have one totalValue.
for example
row 1 activityTotal = 4
row 2 activityTotal = 3
row 3 activityTotal = 1
totalValue = 8
How can I incorporate this into the code?
View 7 Replies
May 14, 2010
I have an ASPXGRIDVIEW which is binded to an SQL query.I added to the grid an additional COLUMNCUSTOMBUTTON.But what happens is, that for all the rows it put a link there.I am trying to find a way to add to this column a link (button) ONLY to specific rows!I am unable to understand how to do it
View 1 Replies
Jan 10, 2010
I need a way to read all the rows in one column from an Excel file that the user picks from a fileupload control. I tried saving the excel file on the webserver with the upload control and then opening it with a OleDbConnection but that fails when running it from the webserver and gives the error:
Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
This works fine when just running it localhost, so i figured it might be a problem with security level at the webserver which i cant change. Instead i tried doing it with a streamreader direct from the fileupload control and because theres no need for saving the excel file on the server, but im not sure how to query the rows i need this way.
View 1 Replies
Nov 22, 2010
I am trying to re-order the jqgrid rows using only one specific column. Currently, the rows can be re-ordered by any column. I have it setup like below:
jQuery("#list").jqGrid('sortableRows', {
update: function (ev, ui) {
SaveRowSorting();
}
});
But the above code allows the rows to be re-ordered by all columns, however we want to restrict it to only one column. E.g, if we have 3 columns in a row. Then, we want the row to be re-ordered by only column1 and it shouldn't allow row sorting using the other two columns.
View 2 Replies
Dec 29, 2010
i have table a with fourcolumns and more which need not be considered i would like the fourth column which has a special charcater ^ within it to act as row seperator such tht the values of 1,2,3 are comon for ALL THE ROWS BASED ON THE SPECIAL CHARACTER.
View 3 Replies
Mar 1, 2011
How to do this? I want to select rows where the datetime column is today's date.
SELECT * FROM table WHERE date = ??
View 5 Replies
May 18, 2010
Here is the query I have now which returns over 2 million records:
[Code]....
This works, but the result is littered with many rows that contain the same SSN. So how do I return only one row for each ssn? I cant use distinct because all of the other columns are already always different, this would return the same as above.
View 11 Replies
Dec 1, 2013
How we can group data in asp template field..
View 1 Replies
Nov 30, 2013
How we can group data in bound field...
1 1-1-2013 x a 1 1-1-2013 x b
1 1-1-2013 x c
2 2-1-2013 y a 2 2-1-2013 y b
2 2-1-2013 y c
i want to show it in this format...
serialNo date name item
1 1-1-2013 x a b
c
2 2-1-2013 y a b
c
View 1 Replies
Aug 20, 2013
I have a gridview with databound fields with a checkbox for each row. Only the check box is not bound to any field in the database. I have a button outside of the gridview. By clicking the button, I am trying to get the values of the partyID fields for all the rows that have the check box checked.
Upon clicking the button, nothing gets displayed but no error either.
Here is my code so far:
aspx code:
<asp:GridView ID="gvFindDupe" runat="server" BackColor="White" BorderColor="#3366CC"
BorderStyle="Solid" BorderWidth="1px" CellPadding="4" AutoGenerateColumns="False" AllowSorting="True">
<FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
<Columns>
[CODE]
View 1 Replies