Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Adding HTML tags to data from SQL server

Reply
Thread Tools

Adding HTML tags to data from SQL server

 
 
Tor Inge Rislaa
Guest
Posts: n/a
 
      11-09-2006
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


 
Reply With Quote
 
 
 
 
seigo
Guest
Posts: n/a
 
      11-09-2006
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 <Columns> and </Columns> tags:

<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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to save html tags at SQL Server? Dexter ASP .Net 9 07-01-2010 07:08 PM
Help. Getting a An error has occurred while establishing a connectionto the server. When connecting to SQL Server 2005, this failure may be causedby the fact that under the default settings SQL Server does not allow remote aboutjav.com@gmail.com ASP .Net 0 05-03-2008 12:43 PM
All style tags after the first 30 style tags on an HTML page are not applied in Internet Explorer Rob Nicholson ASP .Net 3 05-28-2005 03:11 PM
html tags within meta tags allowed? Donald Firesmith XML 5 01-08-2005 11:29 PM
RegEx to find CFML tags nested in HTML tags Dean H. Saxe Perl 0 01-03-2004 06:11 PM



Advertisments