Append records to a Gridview from a control
Hello all.
I have a simple aspx page with a textbox which is the control, gridview and SQLDatasource which connects to a view on our SQL server. It succesfully finds a record when an ID is entered into the textbox.
Here is my problem. I do not wish to just show one record at a time. I wish to build the gridview from the records found, in other words appending records to the gridview.
Has anyone had experiance in this please?
Answers (3)
0
<b> Report Date: 2016-11-21 Optometrist: start Time: Consultant: Dr.suresh</b>
0
Hi,
Please try below query -
- DECLARE @x XML = '<table WIDTH="100%" CELLPADDING="1" CELLSPACING="1">
-
- <tr style="COLOR: black; FONT-FAMILY: Arial; FONT-SIZE: 10pt;BACKGROUND-COLOR: #f2f2f2;">
- <td><b>Report Date : </b>2016-11-21 </td>
- <td><b>Optometrist : </b> </td>
- <td><b>Start Time : </b> </td>
- </tr>
-
- <tr style="COLOR: black; FONT-FAMILY: Arial; FONT-SIZE: 10pt;BACKGROUND-COLOR: #f2f2f2;">
- <td><b>Consultant : </b>Dr.Suresh </td>
- </tr>
-
- </table>'
-
- SELECT t.c.value('.', 'NVARCHAR(MAX)')
- FROM @x.nodes('*') t(c)
Reference :
https://stackoverflow.com/questions/38868364/sql-remove-all-html-tags-in-a-string