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

line breaks

Hi,

I have an sql database with some text (nvarchar) fields. The problem is that
if I get those fields with a datareader (dr.getstring(0)) an then I save text
in a txt file I loose all the line breaks. If I open database Studio
Management I see fields like this:

Això és una proba pel texte sql.

Els canvis de lÃ*nia no es controlen bé

Instead of this line break you see now when a copy/paste text I see small
squares as characters in the database.

I don't know how to keep line breaks when I save text on a txt file...

Any Help?
Thanks

Juan Puebla
Barcelona (Spain)

Jun 10 '06 #1
8 2048
Juan,

Why do you than not use "Text" fields in your database?

Cor

"Juan Puebla" <Ju********@discussions.microsoft.com> schreef in bericht
news:19**********************************@microsof t.com...
Hi,

I have an sql database with some text (nvarchar) fields. The problem is
that
if I get those fields with a datareader (dr.getstring(0)) an then I save
text
in a txt file I loose all the line breaks. If I open database Studio
Management I see fields like this:

Això és una proba pel texte sql.

Els canvis de línia no es controlen bé

Instead of this line break you see now when a copy/paste text I see small
squares as characters in the database.

I don't know how to keep line breaks when I save text on a txt file...

Any Help?
Thanks

Juan Puebla
Barcelona (Spain)

Jun 11 '06 #2
In any case the result is the same.

Juan

"Cor Ligthert [MVP]" wrote:
Juan,

Why do you than not use "Text" fields in your database?

Cor

"Juan Puebla" <Ju********@discussions.microsoft.com> schreef in bericht
news:19**********************************@microsof t.com...
Hi,

I have an sql database with some text (nvarchar) fields. The problem is
that
if I get those fields with a datareader (dr.getstring(0)) an then I save
text
in a txt file I loose all the line breaks. If I open database Studio
Management I see fields like this:

Això és una proba pel texte sql.

Els canvis de lÃ*nia no es controlen bé

Instead of this line break you see now when a copy/paste text I see small
squares as characters in the database.

I don't know how to keep line breaks when I save text on a txt file...

Any Help?
Thanks

Juan Puebla
Barcelona (Spain)


Jun 11 '06 #3
What is the character than that you are using?

Cor

"Juan Puebla" <Ju********@discussions.microsoft.com> schreef in bericht
news:B7**********************************@microsof t.com...
In any case the result is the same.

Juan

"Cor Ligthert [MVP]" wrote:
Juan,

Why do you than not use "Text" fields in your database?

Cor

"Juan Puebla" <Ju********@discussions.microsoft.com> schreef in bericht
news:19**********************************@microsof t.com...
> Hi,
>
> I have an sql database with some text (nvarchar) fields. The problem is
> that
> if I get those fields with a datareader (dr.getstring(0)) an then I
> save
> text
> in a txt file I loose all the line breaks. If I open database Studio
> Management I see fields like this:
>
> Això és una proba pel texte sql.
>
> Els canvis de línia no es controlen bé
>
> Instead of this line break you see now when a copy/paste text I see
> small
> squares as characters in the database.
>
> I don't know how to keep line breaks when I save text on a txt file...
>
> Any Help?
>
>
> Thanks
>
> Juan Puebla
> Barcelona (Spain)
>


Jun 11 '06 #4
The database doesn't change the line breaks at all. They are just plain
characters like any other. When you read the values from the database
you will get them exactly as they were entered in the database.

What are you using to view the text files?

From where does the data come originally?
Juan Puebla wrote:
Hi,

I have an sql database with some text (nvarchar) fields. The problem is that
if I get those fields with a datareader (dr.getstring(0)) an then I save text
in a txt file I loose all the line breaks. If I open database Studio
Management I see fields like this:

Això és una proba pel texte sql.

Els canvis de lÃ*nia no es controlen bé

Instead of this line break you see now when a copy/paste text I see small
squares as characters in the database.

I don't know how to keep line breaks when I save text on a txt file...

Any Help?
Thanks

Juan Puebla
Barcelona (Spain)

Jun 11 '06 #5
Can you add the line breaks back into the string array lines when you save to
a text file?
--
Dennis in Houston
"Juan Puebla" wrote:
Hi,

I have an sql database with some text (nvarchar) fields. The problem is that
if I get those fields with a datareader (dr.getstring(0)) an then I save text
in a txt file I loose all the line breaks. If I open database Studio
Management I see fields like this:

Això és una proba pel texte sql.

Els canvis de lÃ*nia no es controlen bé

Instead of this line break you see now when a copy/paste text I see small
squares as characters in the database.

I don't know how to keep line breaks when I save text on a txt file...

Any Help?
Thanks

Juan Puebla
Barcelona (Spain)

Jun 11 '06 #6
Finally I found a solution. I found out that the character that is breaking
lines is the constant "vbLf". I just have to split the string using this
character and then: TextStreamWriter.writeline

I don't know if it's the best solution but it works!

Thanks to all for your replies!

Juan
(Barcelona)

"Göran Andersson" wrote:
The database doesn't change the line breaks at all. They are just plain
characters like any other. When you read the values from the database
you will get them exactly as they were entered in the database.

What are you using to view the text files?

From where does the data come originally?
Juan Puebla wrote:
Hi,

I have an sql database with some text (nvarchar) fields. The problem is that
if I get those fields with a datareader (dr.getstring(0)) an then I save text
in a txt file I loose all the line breaks. If I open database Studio
Management I see fields like this:

Això és una proba pel texte sql.

Els canvis de lÃ*nia no es controlen bé

Instead of this line break you see now when a copy/paste text I see small
squares as characters in the database.

I don't know how to keep line breaks when I save text on a txt file...

Any Help?
Thanks

Juan Puebla
Barcelona (Spain)

Jun 11 '06 #7

You would better use environment.newline
regards

Michel Posseth [MCP]
"Juan Puebla" <Ju********@discussions.microsoft.com> schreef in bericht
news:CF**********************************@microsof t.com...
Finally I found a solution. I found out that the character that is
breaking
lines is the constant "vbLf". I just have to split the string using this
character and then: TextStreamWriter.writeline

I don't know if it's the best solution but it works!

Thanks to all for your replies!

Juan
(Barcelona)

"Göran Andersson" wrote:
The database doesn't change the line breaks at all. They are just plain
characters like any other. When you read the values from the database
you will get them exactly as they were entered in the database.

What are you using to view the text files?

From where does the data come originally?
Juan Puebla wrote:
> Hi,
>
> I have an sql database with some text (nvarchar) fields. The problem is
> that
> if I get those fields with a datareader (dr.getstring(0)) an then I
> save text
> in a txt file I loose all the line breaks. If I open database Studio
> Management I see fields like this:
>
> Això és una proba pel texte sql.
>
> Els canvis de línia no es controlen bé
>
> Instead of this line break you see now when a copy/paste text I see
> small
> squares as characters in the database.
>
> I don't know how to keep line breaks when I save text on a txt file...
>
> Any Help?
>
>
> Thanks
>
> Juan Puebla
> Barcelona (Spain)
>

Jun 11 '06 #8
You can replace the vbLf string with the string you need for the line
break. Use vbCrLf if you need that specific combination, or
Environment.NewLine if you need the combination used by the current system.

Juan Puebla wrote:
Finally I found a solution. I found out that the character that is breaking
lines is the constant "vbLf". I just have to split the string using this
character and then: TextStreamWriter.writeline

I don't know if it's the best solution but it works!

Thanks to all for your replies!

Juan
(Barcelona)

"Göran Andersson" wrote:
The database doesn't change the line breaks at all. They are just plain
characters like any other. When you read the values from the database
you will get them exactly as they were entered in the database.

What are you using to view the text files?

From where does the data come originally?
Juan Puebla wrote:
Hi,

I have an sql database with some text (nvarchar) fields. The problem is that
if I get those fields with a datareader (dr.getstring(0)) an then I save text
in a txt file I loose all the line breaks. If I open database Studio
Management I see fields like this:

Això és una proba pel texte sql.

Els canvis de lÃ*nia no es controlen bé

Instead of this line break you see now when a copy/paste text I see small
squares as characters in the database.

I don't know how to keep line breaks when I save text on a txt file...

Any Help?
Thanks

Juan Puebla
Barcelona (Spain)

Jun 12 '06 #9

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

Similar topics

12
by: dan glenn | last post by:
Hi. I'm finding that if I have text entered into a <textarea ...> </textarea> in a form, and that text has leading blank lines (with no spaces or anything else), that when I retrieve the entered...
1
by: Bill | last post by:
I am downloading data from a website that displays it in a table $fp = fopen("a website page", 'r'); The following accesses the stream one <td> element at a time $myData = fgets($fp); Then I...
6
by: Jonathan | last post by:
I want to save textarea contents to a mysql database with the paragraph breaks intact without having to type paragraph or break tags in HTML. How can I do that. So far, although it occurs naturally...
12
by: scott | last post by:
Is there a way to prevent IE from forcing a line break? Below in LISTING 2, you notice the table background image extention of '.jpg' begins a new line, instead of staying on the same line as it's...
4
by: intl04 | last post by:
I have a memo field that is included in some Access reports I created. Is there some way for the memo field to display nicely formatted text, with line breaks between paragraphs? Or is it necessary...
2
by: Mike | last post by:
I need my textbox to work more smoothly with respect to line breaks. When I have data pulled from the database into a textbox there are hard line breaks at the end of each line (by definition how...
5
by: joelbyrd | last post by:
Didn't know exactly where to post this, but: How do I get line breaks in a textarea? I'm pulling text from a database, and this text definately has line breaks in it, because I replaced all the...
2
by: caspardh | last post by:
i was trying to code a morse code decipherer which workd fine except that the .txt file that i was converting had linebreaks built in, i cant get python to ignore the line breaks and i cant find any...
8
by: Harris Kosmidis | last post by:
It seems I cannot understand CSS, well. I have donw the following page: http://www.pennias.gr/home.php It's in greek but the context is of no importance. I used a big table to put in my page...
1
by: =?ISO-8859-1?Q?thib=B4?= | last post by:
Hi, Taking a closer look to highlight_file() lastly, I found out that its line break policy was a bit.. strange. <?php # highlight_file() line breaks test $f = fopen('highlight_file_test',...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.