Virendra S from Bangalore, Karnataka Ответов: 1

Как сохранить форматированный текст абзаца в таблице SQL server


пользователь введет сводку своего профиля в веб-форму. текст будет отформатирован жирным шрифтом, строкой, подчеркиванием. hw для хранения данных этого типа в таблице sql server.

образец текста:
<big>What is Lorem Ipsum?</big>
Lorem Ips<small>um is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dumm</small>y text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Why do we use it?
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).


Where does it come from?
<big>Contrary</big> to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur,


Что я уже пробовал:

Table_Profile

Столбцы
идентификатор emp_id
profile_summary

1 Ответов

Рейтинг:
4

OriginalGriff

Вы используете форматирование HTML - поэтому просто сохраните весь HTML в виде строки и сохраните его в столбце SQL в качестве параметра, как и любую другую строку.

Когда вы вытаскиваете его обратно, он все еще остается HTML, поэтому он все еще отформатирован и готов к веб-отображению.