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

about displaying data in datalist control

hi

I have datalist control in my ASP.NET application
the problem here is
i have used a textbox with multiline true propertly when i enter data like

"fdjsfhjksdhfjsdfhsdjhfsdfhsdjfhsd
jfdsjfksdjfksdjkfjsdfjksdjfsdjfd
fdsfhjsdhfjsdhfjf dsjf dsjfhjsdfhjksdh d fdsjf
hsdjkfhdjsfhsdjfh ds
fdsf dshfjdhsjfhsdjhfjsdh fds
dsjfh sdfhdsfjdshfjhdsfds"

it is storing as it is ...when i displaying in the datalist like this
Dim con As New

OleDbConnection("provider=sqloledb;server=localhos t;database=tempdb;trusted_
connection=Yes")
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles

MyBase.Load
Dim da As New OleDbDataAdapter("select * from Message", con)
Dim ds As New DataSet
da.Fill(ds, "Message")
dltMessages.DataSource = ds
dltMessages.DataBind()
End Sub
it is showing in a single line it is not displaying in paragrah wise .......

how to display data in data list as it is.
Please help me ....

thanx in advance
yoshitha
Sep 8 '05 #1
1 2238
yourString.Replace(Environment.NewLine, "<br>")

Try this.....
becasue when displaying the text in the datalist the browser reads it as
html, try using the Replace(Environment.NewLine, "<br>") when storing the
text in the db to replace each LineBreak with <br> in the database so when
getting the value the browser reades the <br> as tags and replaces them with
a Break line.
"Yoshitha" wrote:
hi

I have datalist control in my ASP.NET application
the problem here is
i have used a textbox with multiline true propertly when i enter data like

"fdjsfhjksdhfjsdfhsdjhfsdfhsdjfhsd
jfdsjfksdjfksdjkfjsdfjksdjfsdjfd
fdsfhjsdhfjsdhfjf dsjf dsjfhjsdfhjksdh d fdsjf
hsdjkfhdjsfhsdjfh ds
fdsf dshfjdhsjfhsdjhfjsdh fds
dsjfh sdfhdsfjdshfjhdsfds"

it is storing as it is ...when i displaying in the datalist like this
Dim con As New

OleDbConnection("provider=sqloledb;server=localhos t;database=tempdb;trusted_
connection=Yes")
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles

MyBase.Load
Dim da As New OleDbDataAdapter("select * from Message", con)
Dim ds As New DataSet
da.Fill(ds, "Message")
dltMessages.DataSource = ds
dltMessages.DataBind()
End Sub
it is showing in a single line it is not displaying in paragrah wise .......

how to display data in data list as it is.
Please help me ....

thanx in advance
yoshitha

Sep 8 '05 #2

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

Similar topics

0
by: Alex | last post by:
Interested in more .NET stuff visit www.dedicatedsolutions.co.uk The DataList is not as powerful as the DataGrid. It requires more work from you since it has no default data presentation format....
0
by: Alex | last post by:
Imports System Imports System.Data Imports System.Data.SqlClient Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Configuration Public Class Main : Inherits Page ...
4
by: Martin | last post by:
I want to build a data entry form for creating and updating info on something. When I'm first creating an item all the fields need to be editable. There after some fields become readonly. Most...
10
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
3
by: bbernieb | last post by:
Hi, All, Is it possible to access a variable inside of a data binding, without the variable being out of scope? (Note: On the DataBinder line, I get an error message that says "Name 'i' is...
1
by: Yoshitha | last post by:
Hi I have datalist control in my ASP.NET application the problem here is i have used a textbox with multiline true propertly when i enter data like "fdjsfhjksdhfjsdfhsdjhfsdfhsdjfhsd...
1
by: Yoshitha | last post by:
hi I have datalist control in my ASP.NET application the problem here is i have used a textbox with multiline true propertly when i enter data like "fdjsfhjksdhfjsdfhsdjhfsdfhsdjfhsd...
3
by: Richard Carpenter | last post by:
I understand how to use a dropdown list control to display the associated description value for a foreign key in a parent rather than the key itself, but I don't like having to disable the control...
12
by: brwalias | last post by:
Hi, using .net 2 sql server 2005 Here is my situation: I'm passing a variable in the url from a selection on Page A and need to display the results on the Results page be based on that...
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
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: 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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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.