Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Replace vbCrLf

1 view
Skip to first unread message

David C

unread,
May 2, 2008, 10:57:42 AM5/2/08
to
We have an asp.net page that displays data from a SQL table that is updated
from a VB application. That application uses vbCrLf to denote line breaks.
How can I replace them with "<br />" before they get displayed in my
GridView? Thanks.

David


Cowboy (Gregory A. Beamer)

unread,
May 2, 2008, 11:12:27 AM5/2/08
to
Options:

1. Use the row binding event to do a search/replace
2. Search/replace in your database, before you have the data in .NET

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
"David C" <dlc...@lifetimeinc.com> wrote in message
news:ubps2UGr...@TK2MSFTNGP05.phx.gbl...

David C

unread,
May 2, 2008, 11:16:05 AM5/2/08
to
I want to use option 1 but I get an error. Below is what I have in the row
databound event:

Dim varControl

varControl = e.Row.FindControl("EventNotes")

varControl.Text = Replace(varControl.Text, vbCrLf, "<br />")


"Cowboy (Gregory A. Beamer)" <NoSpamM...@comcast.netNoSpamM> wrote in
message news:uzcBybGr...@TK2MSFTNGP03.phx.gbl...

David Wier

unread,
May 2, 2008, 11:22:01 AM5/2/08
to
What is the error you are getting?


David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup


"David C" <dlc...@lifetimeinc.com> wrote in message

news:%233l9IfG...@TK2MSFTNGP03.phx.gbl...

David C

unread,
May 2, 2008, 11:30:41 AM5/2/08
to
Nevermind. I looked at it again and the control name was misspelled.

David
"David Wier" <d...@dw.com> wrote in message
news:%237bm4hG...@TK2MSFTNGP03.phx.gbl...

Lloyd Sheen

unread,
May 2, 2008, 12:19:10 PM5/2/08
to

"David C" <dlc...@lifetimeinc.com> wrote in message
news:eXJLTnGr...@TK2MSFTNGP04.phx.gbl...

Turn on your options Strict and Explicit.

Compiler will tell you most of your problems before you run.

LS

Jonathan Wood

unread,
May 2, 2008, 12:42:20 PM5/2/08
to
You want someone to help debug an error without saying what that error is?

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"David C" <dlc...@lifetimeinc.com> wrote in message

news:%233l9IfG...@TK2MSFTNGP03.phx.gbl...

b_wind

unread,
May 2, 2008, 1:36:28 PM5/2/08
to
You can replace in SQL query or replace in datarowbind event.
suggest you replace in sql query, like:
select *,replace(TEXTFIELD,'
','<BR />') AS FIELD1 from table

"David C" <dlc...@lifetimeinc.com>
news:ubps2UGr...@TK2MSFTNGP05.phx.gbl...

0 new messages