New line character

I am writing code (VS2008/C#) that reads text file and passes the file data to SQL Server Procedure. I am reading data of file in StreamReader and passing as Input Parameter to procedure. I need to pass the New Line character also to the procedure.

1. The New Line character can be chr(13) & chr(10) or only chr(10). How to check this in C#?
2. How to pass New Line character to SQL Procedure?



1/15/2009 11:33:12 AM 16182 articles. 0 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 38
Get it on Google Play
Get it on Apple App Store

 Try using Environment.NewLine

Hanan Schwartzberg
1/15/2009 11:42:21 AM

Environment.NewLine returns the new line defined in the environment. I need to check how the line is ending in text file?



1/15/2009 12:09:35 PM

 Sorry, I understand now. You can check like this:

if (strText.EndsWith(char.ConvertFromUtf32(13) + char.ConvertFromUtf32(10)))
    //do something
else if (char.ConvertFromUtf32(10))
    //do something

Hanan Schwartzberg
1/15/2009 12:21:48 PM

Similar Artilces:

How to force a new line to keep one line only have 10 characters?
For example, user may input text as below: AAAAAAAAAABBBBBBBBBBCCCCCCCCCC But to make it as: AAAAAAAAAA BBBBBBBBBB CCCCCCCCCC string wholeLine = "AAAAAAAAAABBBBBBBBBBCCCCCCCCCC";List<string> lines = new List<string>();while ( wholeline.Length > 0){    if (wholeline.length >= 10)    {        lines.Add( wholeline.Substring(0, 10);        wholeline = wholeline.Substring (10);    }    else    {       &nb...

New Line Character
i using mysql connect to database and found data like "abcde fgh" how to convert this string from two line into one line? and result become "abcdefgh"  hello friend, suppose your string is called myString= "abcde fgh" and then use myString.Replace(System.Enviornment.NewLine,"") hope it helps, Jessica  Jessica CaoSincerely,Microsoft Online Community Support“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other comm...

new line character
Is there a way to insert a "new line/carriage control" in a varchar column? <Ctrl><Enter> keys work with a text column but just tabs to next control on a varchar column. Tried ~r~n but that just stores/prints the text ~r~n. Seems that <ctrl><enter> used to work in the app. PB 7.02 9028 You can use char(10) + char(13) to get the cr/lf -- Terry Dykstra (TeamSybase) Please state PB / OS / DB versions in your post. MySybase Search Deja: <Mike> wrote in message...

New line character in XML
HI Friends, I am in a deep trouble. If u help me in this issue, it will be greatful. Requirement is as below. I am having a grid which will be bind to a datatable. i will have to show tooltips on the column headers of this gridview. I have an XML file which contains the content for these tooltips. i have written a method which takes a string as a parameter, which is the column name of the gridview. Based on this string that we have passed, the method will pick the content for the tooltip from the XML file and display. But i have a problem here. Here the content of the tooltip can ...

New Line character in a String
I want to create a string which contains a new line character. In Powerbuilder, I would use '~n' but what do I use within a stored procedure in ASE 12.0? I'm trying to create a mulit-line error message that is passed back from the stored procedure to the Powerbuilder front-end. select @message = 'Line1~n Line 2 ~n Line 3" should display like this: Line 1 Line 2 Line 3 Thanks! select @message = "Line 1" + char(10) + "Line 2" + char(10) + "Line 3" select @message RM wrote: > I want to create a string which co...

new line character in the validation
Hi, I have a radiobuttonlist repeatdirection horizontally, and I have a requirefieldvalitor against this field with *. However, when the user miss the field and a red * is outputed, but it goes to the next line. I want them to be on the same line. How can I do that? Thanks. post some code? There may not be enough space on the line for it to go there so it automatically goes to the next line Actually there are still a lot of space on the line. here's the code.  <asp:RadioButtonList ID="GenderSelect" runat="server" RepeatDirection="Horizontal" ...

Crossplatform new line character
I need to split a caption of a TCheckBox in two lines at a specific place. So, I set CheckBox1.WordWrap to True, adjust its height and sofar OK, if the text is long enough, it wraps to a second line. Q1: I can't figure out how to enter a carriage return, line feed or both in the object inspector. Is it possible? A workaround is to define a string const: const CR = #$0D; cbCaption = 'The text that needs to' + CR + 'wrap around'; and then in the forms OnCreate assign it to CheckBox1.Caption I also tested with LF = #$0A and CRLF = CR + LF, and on Windows al...

New Line Character(s)
Greetings. I've got some Perl code that's inserting data into a MySQL, which is later being read & displayed by MS Access. I'm constructing a note, and I'm using: \n for new lines - to break up paragraphs. However, in Access, these \n characters appear as little boxes instead of new lines. What should I use to get Access to display a new line? -- Daniel Kasak IT Developer NUS Consulting Group Level 5, 77 Pacific Highway North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: website: http:...

how to skip new line character
------=_NextPart_000_0015_01C49666.30D23690 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi All As a beginner in PERL, I wrote a small program which reads data from the = file and stores in an array. In that process i wanted to skip the new = line character... for ex: In my program say "a.txt" contains man pan tan In the program open INPUT,"a.txt" or die $!; my @file =3D <INPUT>; when I print the file, I could see $file[2] and $file[4] has only new = line character... So while...

C-style new line characters
v10.01 I updated a table in ISQL and in my app along the lines of UPDATE "people" SET "col"='abc\nmo' etc then "select cast(col as binary) etc" gives [97, 98, 99, 10, 109, 111] - i.e. the \n was changed to new line character While UPDATE "people" SET "col"='abc\nmo\t12\r34' ...; gives abc mo\t12\r34 The tab and carriage return are not interprted C-style; just the \n. So why is the \n? When did this happen? Why does this happen? Can I turn this behaviour off ? Yes I can escape it with another \ but t...

add a new line character in label
How do i add a new line character in a label content? I tried system.environment.newline and it doesn't work. "<br/>"LolliDon't forget to click "Mark as Answer" on the post that helped you. This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped. Hi, try this  lbl1.Text = lbl1.Text+ "<br />" Public Shared Function BrakeRow(ByVal _count As Integer) As LiteralControl Dim tmp As String = "" Dim i As Integer For i = 0 To _count ...

New line character in email notifications
Quick question...... How do you insert a new line in an email sent by Identity Manager? I am sending an email with user information and would like to have the info on separate lines, instead of separated by comas. I think I have seen this answer before somewhere on the Novell site, but I cant find it now. Anyone know? Thanks for any response, Jordan -- Father Ramon wrote: > Quick question...... How do you insert a new line in an email sent by > Identity Manager? I am sending an email with user information and...

Datawindow Text Object New Line
Datawindow Text Object New Line Hi. I am trying to create a new line in a text object by specifying (for example) Dim strTitle as String = "Hotel VIP Guests~n Report~n For Month of January to December 2008" then use the datawindow modify like: wdw.Modify("report_title.text = '" & strTitle & "'") the web datawindow displays in the text object: Hotel VIP Guests Report For Month of January to December 2008 which is far from the desired result which should be: Hotel VIP Guests Report For Month of January to December 2008 ...

ASCII import
I am importing ascii text files to tables in an whatcom 4 db. For some big text fields i need to put a "newline" character in order to get a new line in i.e varchar fileds. I have tried � ~n with no success. any postings will be appreciated. Per H. Kleppe Try using \n. Watcom/SQL Anywhere reads the C special print characters, sometimes when you don't want it to. -- Jim Egan [TeamPS] Dealer Solutions, LLC Houston, TX This is a multi-part message in MIME format. ------=_NextPart_000_0005_01BCD822.8928C750 Content-Type: text/plain; charset="iso...

Web resources about - New line character -

Dilbert (character) - Wikipedia, the free encyclopedia
Dilbert is a fictional character and the main character and protagonist of the Dilbert comic strip . He is a white collar office worker who has ...

How Will a 10,000-Character Limit Change Twitter Marketing?
... returning as CEO and some notable layoffs — Twitter is poised to make one of its most drastic changes yet, expanding the infamous 140 character ...

Jack & Coke renamed "The Lemmy" by Food & Beverage magazine; Lemmy now a GTA V character
by Rob Sperry-Fromm In the wake of Lemmy's passing, tributes to the Motorhead frontman have come from all over the place, including a petition ...

George Clooney is starring in a movie called 'Money Monster,' and his character is clearly a play on ...
"Ocean's 11" stars George Clooney and Julia Roberts are co-starring in the upcoming financial news thriller "Money Monster", directed by Jodie ...

How to make 'deadbeat dads' pay in 140 characters or less
Arizona governor Doug Ducey has launched a controversial new initiative to publicly shame suspected "deadbeat dads," tweeting out their names ...

Nintendo promises to bring characters you love to mobile
... company promises it has greater things up its sleeve for 2016. Nintendo president Tatsumi Kimishima has confirmed plans to bring the characters ...

Barbara Allyne Bennet Dies: Veteran Character Actress Was 76
Barbara Allyne Bennet , a veteran character actress and former SAG board member, has died January 9. She was 76. A Cleveland native, Bennet moved ...

'Walking Dead' Star Lauren Cohan Says Fans Should Be 'Concerned' for Her Character
'Walking Dead' Star Lauren Cohan Says Fans Should Be 'Concerned' for Her Character

'Lucifer' Review: An Unsure Pilot With Big Character Based Potential
Lucifer is coming to Fox, but describing the show is harder than one might imagine.

Rogue One Could Feature a Star Wars Character We Thought We'd Never See Again
Civil War will balance its dark moments with some superhero humor. The long-awaited Jumanji reboot gets a director. Chris Pine talks Wonder Woman ...

Resources last updated: 1/16/2016 5:49:43 AM