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

Working with text.


Hello,
I have stored some text in my database. I want to retrive the first two
lines from text and display it in a an asp.net page..
How to get the first two lines from my text?

Any good way of doint this?
Many thanks
JB
Nov 16 '05 #1
4 1149
On Sat, 26 Feb 2005 11:08:50 +0100, "Jensen bredal"
<je************@yahoo.com> wrote:

Hello,
I have stored some text in my database. I want to retrive the first two
lines from text and display it in a an asp.net page..
How to get the first two lines from my text?

Any good way of doint this?
Many thanks
JB

Can you explain this more ? It's a little too vague for me, at least,
to understand what you're tyring to do.

Michael Hughes - Silverton, Oregon
http://wou.ath.cx/Trivia
http://wou.ath.cx/AmateurRadio
Nov 16 '05 #2
I have a database field as ntext.
I want to display this page only the first two lines. i retriev
the field in my c# code as text.

How do i process it to display the first two "newline terminated" character
sequences
in my text?


"Michael H" <Mi*****@Strawberry.Gatorade.yum> wrote in message
news:45********************************@4ax.com...
On Sat, 26 Feb 2005 11:08:50 +0100, "Jensen bredal"
<je************@yahoo.com> wrote:

Hello,
I have stored some text in my database. I want to retrive the first two
lines from text and display it in a an asp.net page..
How to get the first two lines from my text?

Any good way of doint this?
Many thanks
JB

Can you explain this more ? It's a little too vague for me, at least,
to understand what you're tyring to do.

Michael Hughes - Silverton, Oregon
http://wou.ath.cx/Trivia
http://wou.ath.cx/AmateurRadio

Nov 16 '05 #3
On Sat, 26 Feb 2005 12:06:38 +0100, "Jensen bredal"
<je************@yahoo.com> wrote:
I have a database field as ntext.
I want to display this page only the first two lines. i retriev
the field in my c# code as text.

How do i process it to display the first two "newline terminated" character
sequences
in my text?

If you're referring to showing the text up to the 2nd new line escape
character, "\n", then perhaps something similar to this:

//assuming you're placing each row's returned text into a string; str

//string str;

int i = str.IndexOf(Environment.NewLine); // find 1st newline
int i = str.IndexOf(Environment.NewLine, i+1); // fine 2nd newline

str = str.Substring(0, i); // return text from start to 2nd newline


There may be a better way of finding the 2nd instance of the
Environment.NewLine or "\n" but it's 3:26 am here and I'm a bit
sleepy. Let me know if this is similar to what you're looking for. I'm
sure this is by far not the best solution. Også, I may just not be
understanding clearly your question.

adjø fra Oregon!
Michael Hughes - Silverton, Oregon
http://wou.ath.cx/Trivia
http://wou.ath.cx/AmateurRadio
Nov 16 '05 #4
You might want to investigate the ReadLine method of the StringReader class:

http://msdn.microsoft.com/library/de...dlinetopic.asp
"Jensen bredal" <je************@yahoo.com> wrote in message
news:OB****************@tk2msftngp13.phx.gbl...

Hello,
I have stored some text in my database. I want to retrive the first two
lines from text and display it in a an asp.net page..
How to get the first two lines from my text?

Any good way of doint this?
Many thanks
JB

Nov 16 '05 #5

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

Similar topics

14
by: Roland Hall | last post by:
I have two(2) issues. I'm experiencing a little difficulty and having to resort to a work around. I already found one bug, although stated the bug was only in ODBC, which I'm not using. It...
8
by: lawrence | last post by:
I'm a beginner with Javascript and especially cross-browser Javascript. I got this working in IE, but not in Netscape 7. It seems like, in Netscape, every time I click on a button, the focus shifts...
9
by: Tom | last post by:
I am working with the this object as oppose to the StreamReader object becuase I need to access a file (to find the contents) while an external application is updating the file. When I was...
5
by: Brian | last post by:
Hello all.. Am working on an Air Hockey game... have an table loaded into a picture box. The borders of the table are slightly slanted. Am using hit testing lines with GDI+ to manipulate the...
5
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
8
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs...
3
by: sivavenugopal | last post by:
Hi All, I am using a table in my page. I am changing the size (width and Height) of the table while resize of the browser. It is working fine with IE but not working with FF. Please provide me the...
31
by: ajos | last post by:
hi frnds, i have a form,which has 2 input text boxes, the values are entering the text boxes,when i leave the 2 text boxes blank and hit submit a java script gives the message that the 2 fields are...
3
by: =?Utf-8?B?Sm9obkJhdGVz?= | last post by:
I'm trying to (programatically) backup and clear the security event log on the local machine. I can do this manually through the event viewer and I am logged on as an administrator. I can...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.