Hello,
I'm creating something like a web site builder in ASP.Net, and I need to
store an HTML code in the SQL server table. If my customer just enters an
HTML code, it is stored in the SQL server table like this: <table
cellSpacing="0" cellPadding="0" width="760"
border="0">, instead of <table cellSpacing="0" cellPadding="0"
width="760" border="0">
This significantly increases the size of the stored code.
Are there any conversion functions or something like this to avoid it? Where
this conversion should be done - in ASP.Net or SQL server? How do I convert
it back to create an HTML page?
Please note that I must use the Unicode data type - ntext, nchar etc, since
I'm using some Cyrillic characters.
I would appreciate your advice very much.
Thank you,
--
Peter AfoninPeter,
ntext in SQL Server will store Html markup just fine. You are encoding
your html before storing it in the database. Find out where you are
encoding the markup and change that code. Debug your code and make sure
that you are indeed sending pure html to the database. SQL Server will not
automatically encode html, so your code is doing it somewhere.
Best regards,
Jeffrey Palermo
"Peter Afonin" <pva@.speakeasy.net> wrote in message
news:eyXuQOa1EHA.3820@.TK2MSFTNGP11.phx.gbl...
> Hello,
> I'm creating something like a web site builder in ASP.Net, and I need to
> store an HTML code in the SQL server table. If my customer just enters an
> HTML code, it is stored in the SQL server table like this: <table
> cellSpacing="0" cellPadding="0" width="760"
> border="0">, instead of <table cellSpacing="0"
cellPadding="0"
> width="760" border="0">
> This significantly increases the size of the stored code.
> Are there any conversion functions or something like this to avoid it?
Where
> this conversion should be done - in ASP.Net or SQL server? How do I
convert
> it back to create an HTML page?
> Please note that I must use the Unicode data type - ntext, nchar etc,
since
> I'm using some Cyrillic characters.
> I would appreciate your advice very much.
> Thank you,
> --
> Peter Afonin
>|||What is the code you use to store the string you get in the SQL database?
"Peter Afonin" <pva@.speakeasy.net> a écrit dans le message de
news:eyXuQOa1EHA.3820@.TK2MSFTNGP11.phx.gbl...
> Hello,
> I'm creating something like a web site builder in ASP.Net, and I need to
> store an HTML code in the SQL server table. If my customer just enters an
> HTML code, it is stored in the SQL server table like this: <table
> cellSpacing="0" cellPadding="0" width="760"
> border="0">, instead of <table cellSpacing="0"
cellPadding="0"
> width="760" border="0">
> This significantly increases the size of the stored code.
> Are there any conversion functions or something like this to avoid it?
Where
> this conversion should be done - in ASP.Net or SQL server? How do I
convert
> it back to create an HTML page?
> Please note that I must use the Unicode data type - ntext, nchar etc,
since
> I'm using some Cyrillic characters.
> I would appreciate your advice very much.
> Thank you,
> --
> Peter Afonin
>
>|||As the other poster states, it is not SQL that is doing the encoding, it is
something else...
Also, if the html pages will be less than 4000 unicode characters, you may
prefer to strore the data in a varchar column.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Peter Afonin" <pva@.speakeasy.net> wrote in message
news:eyXuQOa1EHA.3820@.TK2MSFTNGP11.phx.gbl...
> Hello,
> I'm creating something like a web site builder in ASP.Net, and I need to
> store an HTML code in the SQL server table. If my customer just enters an
> HTML code, it is stored in the SQL server table like this: <table
> cellSpacing="0" cellPadding="0" width="760"
> border="0">, instead of <table cellSpacing="0"
cellPadding="0"
> width="760" border="0">
> This significantly increases the size of the stored code.
> Are there any conversion functions or something like this to avoid it?
Where
> this conversion should be done - in ASP.Net or SQL server? How do I
convert
> it back to create an HTML page?
> Please note that I must use the Unicode data type - ntext, nchar etc,
since
> I'm using some Cyrillic characters.
> I would appreciate your advice very much.
> Thank you,
> --
> Peter Afonin
>|||Thank you everyone for your suggestions.
So far when I use ntext it works OK, then I use the Literal control and
Server.Decode to write the data in ASP.Net.
Peter
"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:eL$4fPh1EHA.4004@.tk2msftngp13.phx.gbl...
> As the other poster states, it is not SQL that is doing the encoding, it
is
> something else...
> Also, if the html pages will be less than 4000 unicode characters, you may
> prefer to strore the data in a varchar column.
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Peter Afonin" <pva@.speakeasy.net> wrote in message
> news:eyXuQOa1EHA.3820@.TK2MSFTNGP11.phx.gbl...
> > Hello,
> >
> > I'm creating something like a web site builder in ASP.Net, and I need to
> > store an HTML code in the SQL server table. If my customer just enters
an
> > HTML code, it is stored in the SQL server table like this: <table
> > cellSpacing="0" cellPadding="0"
width="760"
> > border="0">, instead of <table cellSpacing="0"
> cellPadding="0"
> > width="760" border="0">
> >
> > This significantly increases the size of the stored code.
> >
> > Are there any conversion functions or something like this to avoid it?
> Where
> > this conversion should be done - in ASP.Net or SQL server? How do I
> convert
> > it back to create an HTML page?
> >
> > Please note that I must use the Unicode data type - ntext, nchar etc,
> since
> > I'm using some Cyrillic characters.
> >
> > I would appreciate your advice very much.
> >
> > Thank you,
> >
> > --
> > Peter Afonin
> >
> >
>|||Wayne,
Maybe it's just a typo, but varchar cannot be properly used with unicode
and has a maximum length of 8000 characters. nvarchar has a limit of 4000
characters and should be used for all applications for maintenance purposes
(since most applications will have to support unicode in the future).
Best regards,
Jeffrey Palermo
Blog: http://dotnetjunkies.com/weblog/jpalermo
"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:eL$4fPh1EHA.4004@.tk2msftngp13.phx.gbl...
> As the other poster states, it is not SQL that is doing the encoding, it
is
> something else...
> Also, if the html pages will be less than 4000 unicode characters, you may
> prefer to strore the data in a varchar column.
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Peter Afonin" <pva@.speakeasy.net> wrote in message
> news:eyXuQOa1EHA.3820@.TK2MSFTNGP11.phx.gbl...
> > Hello,
> >
> > I'm creating something like a web site builder in ASP.Net, and I need to
> > store an HTML code in the SQL server table. If my customer just enters
an
> > HTML code, it is stored in the SQL server table like this: <table
> > cellSpacing="0" cellPadding="0"
width="760"
> > border="0">, instead of <table cellSpacing="0"
> cellPadding="0"
> > width="760" border="0">
> >
> > This significantly increases the size of the stored code.
> >
> > Are there any conversion functions or something like this to avoid it?
> Where
> > this conversion should be done - in ASP.Net or SQL server? How do I
> convert
> > it back to create an HTML page?
> >
> > Please note that I must use the Unicode data type - ntext, nchar etc,
> since
> > I'm using some Cyrillic characters.
> >
> > I would appreciate your advice very much.
> >
> > Thank you,
> >
> > --
> > Peter Afonin
> >
> >
>|||Peter, I'm glad you have it working now.
--
Best regards,
Jeffrey Palermo
Blog: http://dotnetjunkies.com/weblog/jpalermo
"Peter Afonin" <peter@.gudzon.net> wrote in message
news:OAMi7Mk1EHA.1124@.tk2msftngp13.phx.gbl...
> Thank you everyone for your suggestions.
> So far when I use ntext it works OK, then I use the Literal control and
> Server.Decode to write the data in ASP.Net.
> Peter
> "Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
> news:eL$4fPh1EHA.4004@.tk2msftngp13.phx.gbl...
> > As the other poster states, it is not SQL that is doing the encoding, it
> is
> > something else...
> >
> > Also, if the html pages will be less than 4000 unicode characters, you
may
> > prefer to strore the data in a varchar column.
> >
> > --
> > Wayne Snyder, MCDBA, SQL Server MVP
> > Mariner, Charlotte, NC
> > www.mariner-usa.com
> > (Please respond only to the newsgroups.)
> >
> > I support the Professional Association of SQL Server (PASS) and it's
> > community of SQL Server professionals.
> > www.sqlpass.org
> >
> > "Peter Afonin" <pva@.speakeasy.net> wrote in message
> > news:eyXuQOa1EHA.3820@.TK2MSFTNGP11.phx.gbl...
> > > Hello,
> > >
> > > I'm creating something like a web site builder in ASP.Net, and I need
to
> > > store an HTML code in the SQL server table. If my customer just enters
> an
> > > HTML code, it is stored in the SQL server table like this: <table
> > > cellSpacing="0" cellPadding="0"
> width="760"
> > > border="0">, instead of <table cellSpacing="0"
> > cellPadding="0"
> > > width="760" border="0">
> > >
> > > This significantly increases the size of the stored code.
> > >
> > > Are there any conversion functions or something like this to avoid it?
> > Where
> > > this conversion should be done - in ASP.Net or SQL server? How do I
> > convert
> > > it back to create an HTML page?
> > >
> > > Please note that I must use the Unicode data type - ntext, nchar etc,
> > since
> > > I'm using some Cyrillic characters.
> > >
> > > I would appreciate your advice very much.
> > >
> > > Thank you,
> > >
> > > --
> > > Peter Afonin
> > >
> > >
> >
> >
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment