c# - Save formatted plain text into SQL Server? -


i have text file following content

hdcnwupc  2014110616414617001509cn   dt01u00008            ak ctn head lettuce  

i need save sql table nvarchar column. distorted content when retreive values.

hdcnwupc  2014110616414617001509cn     dt01u00008            ak ctn head lettuce 

this not html content, plain text text file, spacing have significance. need implement in c#. following code reads content text file.

var k = system.io.file.readalltext(@location); 

what might suitable way ?

try (add encoding parameter)

var k = system.io.file.readalltext(@location,, encoding.ascii); 

refer here documentation


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -