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?Thanks
![]() |
0 |
![]() |
Try using Environment.NewLine
Hanan Schwartzberg
--------------------
http://www.lionsden.co.il
![]() |
0 |
![]() |
Environment.NewLine returns the new line defined in the environment. I need to check how the line is ending in text file?
Thanks
![]() |
0 |
![]() |
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
--------------------
http://www.lionsden.co.il
![]() |
0 |
![]() |