Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net write text file

Hi
I am trying t writ the following connection string which is held in the text of a label
as one line. How do I do this?

I tried          writer.WriteLine(lblConnectionString.Text.Replace(vbCrLf, ""))
but it was still written as 3 ines

Server=tcp:otzkwyko1e.database.windows.net;Database=sace;
User ID= saceuser@otzkwyko1e;Password= xxxx;Trusted_Connection=False;
Encrypt=True;
Avatar of Ganapathi
Ganapathi
Flag of India image

Use Write() instead of WriteLine().

writer.Write(lblConnectionString.Text.Replace(vbCrLf, ""))

Open in new window

Avatar of Nasir Razzaq
How are you looking at the line? Could it be that its a single line but wordwrapped due to its width?
Avatar of Murray Brown

ASKER

Hi CodeCruiser. That might well be the case. I just want to make sure that if there are multiple lines that it converts them into one. Is there perhaps a way to do this by looping or the like?
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks