I am having a problem and I was wondering if or what the solution is. I am using ASP.NET to get data from a database and then display it on a web page using the GridView control. I have one column that concatenates together the values from several table columns. I would like to have the output displayed with html formatting where I can add breaks between some of the lines.
The column holds address info for people in the database. It combines the data from the address1, address2, city, state, and zipcode columns into one column. I would like there to be breaks between address1 and address2 and between address2 and city. Does anyone know if it is possible to write this into the SELECT statement directly? This is what the Address column looks like in the SELECT statement:
If you tried, you would see that it's quite possible. However, from a design perspective I do not like it, as you partially move presentation into the SQL Server. In my opinion, this kind of formatting should reside in ASP.NET, and not in SQL Server.
Thank you for the response. I don't mean to be rude, but I have tried and was unsuccessful and that is why I'm posting on here with the hope that someone who knows this stuff can help me out.
I understand the importance of clearly delineating between presentation and logic, but the only other way I can see doing it in ASP would be to use a row databound event to format the cells that are generated with the gridview control, and I think that would require a lot more work than just specifying the html tags in the SQL select statement, if it is even possible...