|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
line breaksI 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) Juan,
Why do you than not use "Text" fields in your database? Cor Show quoteHide quote "Juan Puebla" <JuanPue***@discussions.microsoft.com> schreef in bericht news:1927C558-AD2F-4370-B64E-960866219585@microsoft.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) > In any case the result is the same.
Juan Show quoteHide quote "Cor Ligthert [MVP]" wrote: > Juan, > > Why do you than not use "Text" fields in your database? > > Cor > > "Juan Puebla" <JuanPue***@discussions.microsoft.com> schreef in bericht > news:1927C558-AD2F-4370-B64E-960866219585@microsoft.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) > > > > > What is the character than that you are using?
Cor Show quoteHide quote "Juan Puebla" <JuanPue***@discussions.microsoft.com> schreef in bericht news:B77CB3A4-E6B1-4352-98BC-C55F2B945714@microsoft.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" <JuanPue***@discussions.microsoft.com> schreef in bericht >> news:1927C558-AD2F-4370-B64E-960866219585@microsoft.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) >> > >> >> >> 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: Show quoteHide quote > 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) > 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) Show quoteHide quote "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) > > > You would better use environment.newline
regards Michel Posseth [MCP] Show quoteHide quote "Juan Puebla" <JuanPue***@discussions.microsoft.com> schreef in bericht news:CF078991-9020-4F65-B6A5-C4DAE257FCDE@microsoft.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) >> > >> 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: Show quoteHide quote > 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) >>> Can you add the line breaks back into the string array lines when you save to
a text file? -- Show quoteHide quoteDennis 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) >
Error converting FILETIME to DateTime
Report viewer Page margins problem two-dimensional arrays Is there a built in command to encode SQL strings? Read text-segment from binary file Where is Page.RegisterClientScriptBlock Available? richtextbox selectedtext bold upper .... how to find out creating code on the fly at runtime How to get all files from http server elapsed between 2 dates |
|||||||||||||||||||||||