[Solved] Using gridview to display string data vertically in a row


Assuming I understand your need, you could try something like the following:

/* Create a mock-up table with sample data */

DECLARE @Data TABLE (
    InstrumentID INT, InstrumentType VARCHAR(50), InstrumentNumber INT, NANumber INT, DateTimeFiled DATETIME, [Name] VARCHAR(255) 
);

INSERT INTO @Data ( InstrumentID, InstrumentType, InstrumentNumber, NANumber, DateTimeFiled, [Name] )
VALUES
    ( 1625168, 'ACCOUNTS RECEIVABLE', 1, 785401, '1989-01-03 09:48:03.000', 'HIBERNIA NATIONAL BANK NEW ORLEANS' ),
    ( 1382385, 'SALE', 1, 785467, '1989-01-03 10:14:03.000', 'M & M RESTAURANT AND LOUNGE, INC' );

/* "Pivot" the columnar data */
SELECT
    x.f.value( 'fn:local-name(.)', 'VARCHAR(50)' ) AS [name],
    x.f.value( '.', 'VARCHAR(255)' ) AS [value]
FROM (
    
    /* Insert your T-SQL here... */
    SELECT CAST ( ( SELECT
        InstrumentID, InstrumentType, InstrumentNumber, NANumber, DateTimeFiled, [Name]
    FROM @Data
    FOR XML PATH( 'Data' ) ) AS XML ) AS DataXml

) AS d
CROSS APPLY d.DataXml.nodes( '//Data/*' ) x( f );

Returns

+------------------+------------------------------------+
|       name       |               value                |
+------------------+------------------------------------+
| InstrumentID     | 1625168                            |
| InstrumentType   | ACCOUNTS RECEIVABLE                |
| InstrumentNumber | 1                                  |
| NANumber         | 785401                             |
| DateTimeFiled    | 1989-01-03T09:48:03                |
| Name             | HIBERNIA NATIONAL BANK NEW ORLEANS |
| InstrumentID     | 1382385                            |
| InstrumentType   | SALE                               |
| InstrumentNumber | 1                                  |
| NANumber         | 785467                             |
| DateTimeFiled    | 1989-01-03T10:14:03                |
| Name             | M & M RESTAURANT AND LOUNGE, INC   |
+------------------+------------------------------------+

1

solved Using gridview to display string data vertically in a row