473,395 Members | 1,502 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,395 software developers and data experts.

Replace vbCrLf

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
Jun 27 '08 #1
7 1825
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" <dl*****@lifetimeinc.comwrote in message
news:ub**************@TK2MSFTNGP05.phx.gbl...
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

Jun 27 '08 #2
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)" <No************@comcast.netNoSpamMwrote in
message news:uz**************@TK2MSFTNGP03.phx.gbl...
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" <dl*****@lifetimeinc.comwrote in message
news:ub**************@TK2MSFTNGP05.phx.gbl...
>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


Jun 27 '08 #3
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" <dl*****@lifetimeinc.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>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)" <No************@comcast.netNoSpamMwrote in
message news:uz**************@TK2MSFTNGP03.phx.gbl...
>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" <dl*****@lifetimeinc.comwrote in message
news:ub**************@TK2MSFTNGP05.phx.gbl...
>>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



Jun 27 '08 #4
Nevermind. I looked at it again and the control name was misspelled.

David
"David Wier" <dw@dw.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
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" <dl*****@lifetimeinc.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>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)" <No************@comcast.netNoSpamMwrote in
message news:uz**************@TK2MSFTNGP03.phx.gbl...
>>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" <dl*****@lifetimeinc.comwrote in message
news:ub**************@TK2MSFTNGP05.phx.gbl...
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



Jun 27 '08 #5

"David C" <dl*****@lifetimeinc.comwrote in message
news:eX**************@TK2MSFTNGP04.phx.gbl...
Nevermind. I looked at it again and the control name was misspelled.

David
"David Wier" <dw@dw.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>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" <dl*****@lifetimeinc.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>>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)" <No************@comcast.netNoSpamMwrote
in message news:uz**************@TK2MSFTNGP03.phx.gbl...
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" <dl*****@lifetimeinc.comwrote in message
news:ub**************@TK2MSFTNGP05.phx.gbl...
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
>



Turn on your options Strict and Explicit.

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

LS

Jun 27 '08 #6
You want someone to help debug an error without saying what that error is?

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

"David C" <dl*****@lifetimeinc.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>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)" <No************@comcast.netNoSpamMwrote in
message news:uz**************@TK2MSFTNGP03.phx.gbl...
>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" <dl*****@lifetimeinc.comwrote in message
news:ub**************@TK2MSFTNGP05.phx.gbl...
>>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


Jun 27 '08 #7
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" <dl*****@lifetimeinc.com>
news:ub**************@TK2MSFTNGP05.phx.gbl...
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
Jun 27 '08 #8

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

Similar topics

2
by: jason | last post by:
Hello. I just converted some data to to sql2000 into a TEXT type field. I needed to remove all tabs from the data and now want to remove extra lines too. As we know, SQL2000's replace function...
2
by: Grant Mills | last post by:
I'm trying to get linefeeds to display correctly in a datagrid (text is taken from a database of text that has been htmlencoded) By default it doesn't display them. But <br/> tags display fine. ...
1
by: Grant Mills | last post by:
I'm trying to get linefeeds to display correctly in a datagrid (text is taken from a database of text that has been htmlencoded) By default it doesn't display them. But <br/> tags display fine. ...
15
by: tshad | last post by:
How do I go about this? I used to know this, but can't find VB.net replace that does this. Something like string.replace("<br>",NL) Thanks,
4
by: Neo Geshel | last post by:
Greetings I am using VB in my ASP.NET project that uses an admin web site to populate a database that provides content for a front end web site. I am looking for a way to use replace() to...
8
by: Guy | last post by:
Hi, I'm trying to run this code : strFileContentsHTML.Replace(vbLf, "<br>") strFileContentsHTML.Replace(vbCrLf, "<br>") strFileContentsHTML.Replace(vbCr, "<br>") It doesn't replace newline...
6
by: alainfri | last post by:
I am not sure if this group is the right place for this question but what I need is as follows. There is a piece of html. Throughout the html there are a lot of <brtags. The task is to replace all...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.