473,378 Members | 1,152 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Adding HTML tags to data from SQL server

Adding HTML tags to data from SQL server

When dragging a table on to a web form in an ASP.NET 2.0 application, the
connection is established and the data is displayed in a DataGrid. Is it
possible to manipulate the selected data before it is displayed as HTML
data. E.g adding some HTML tags to the value of a datafield.

TIRislaa
Nov 9 '06 #1
1 1867
Hi,

1. You can change sql query which you use for selecting data. And use
concatenation. For example:

select FirstName + ', ' + LastName from dbo.Users

2. You can setup apperance of each column in DataGrid control. For
this, list all columns between <Columnsand </Columnstags:

<Columns>
....
<asp:TemplateColumn HeaderText="Name">
<ItemTemplate>
<%# Eval("FirstName") %>, <%# Eval("LastName") %>
</ItemTemplate>
</asp:TemplateColumn>
....
</Columns>

For more information refer msdn
(http://msdn2.microsoft.com/en-us/lib...datagrid.aspx).

3. You can change the value of each rows redeclaring DataBinding event
of DataGrid -
http://msdn2.microsoft.com/en-us/lib...tabinding.aspx.

If it's just design purpose then method #2 fits the best.

Alexander Kleshchevnikov
www.klalex.com

"""Tor Inge Rislaa ΠΙΣΑΜ(Α):
"""
Adding HTML tags to data from SQL server

When dragging a table on to a web form in an ASP.NET 2.0 application, the
connection is established and the data is displayed in a DataGrid. Is it
possible to manipulate the selected data before it is displayed as HTML
data. E.g adding some HTML tags to the value of a datafield.

TIRislaa
Nov 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Shannon Jacobs | last post by:
Trying to solve this with a regex approach rather than the programmatic approach of counting up and down the levels. I have a fairly complicated HTML page that I want to simplify. I've been able to...
4
by: Kjell Arne | last post by:
Hi, How do one add parameters to a URL from a UserControl? My problem is that I want to set a unique value to the webpage when the page loads. This value I will use as a identifier for that...
1
by: Jax | last post by:
I am looking to populate web page with controls as a result of a database query. eg (pseudocode) <% foreach(Garment g in GetStuffFromDB()) { //add controls Response.Write("<asp:Button id =...
7
by: | last post by:
What is the beat way to dynamically write/add to the HEAD tag of an ASPX page (the <head runat=server ... is too error prone and not very repeatable)? Thanks.
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
10
by: Barry L. Camp | last post by:
Hi all... hope someone can help out. Not a unique situation, but my search for a solution has not yielded what I need yet. I'm trying to come up with a regular expression for a...
2
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have...
1
by: CapRand | last post by:
Hi, I am creating an ASP.NET site and have created a form which I have been able to dynamically with listboxes, labels etc from a database - using mainly form1.Controls.Add ..... Does anyone...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.