Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8979

reading text from database instead of reading string

$
0
0

hi

i created a cms for a razor based website.

so i save a text into a database as text and it's also show as text int the database (with new lines etc.)

but when i read it to display it as text in the website it seems, that the commands

 @{
      var db = Database.Open("StarterSite");
      var sql = "SELECT * FROM content WHERE Id=0";     
      var row = db.QuerySingle(sql, 0);  
            var about = row.About;

}
<br><p>@about</p>

read it as string, but not as text, and i said, that the type should be ntext.

is there any command to read it as a text, not as a string??

thank you for your help in advance

Marco Cacciatore


Viewing all articles
Browse latest Browse all 8979


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>