Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Insert HTMl code in Database

Author  Topic 

shapper
Constraint Violating Yak Guru

450 Posts

Posted - 2008-02-23 : 20:43:26
Hello,

I am creating an ASP.NET web site which inserts data in a SQL database using LINQ.

One table column will hold HTML code. I am using a simple TextBox to input the data.

I would like to create my text in my computer and then copy/paste the HTML code to my TextBox and insert in the database.

What software should I use to create my text? Microsoft Office 2007, ... ? Any suggestion would be great.

Can I do it this way?

Thanks,

Miguel

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2008-02-23 : 20:44:57
Notepad ++ works excellent for text formatting and supports a ton of languages....free downloads for it all over...just Google for Notepad++



Poor planning on your part does not constitute an emergency on my part.

Go to Top of Page

megbot
Starting Member

17 Posts

Posted - 2008-02-25 : 14:01:54
don't use MS Word to type text for an HTML page. It prints ' and " differently, as the left and right quotation marks. Those symbols in HTML are handled differently, and in some browsers displayed as a <?> because the browser doesn't know how to handle the foreign character.

The Notepad ++ would work, or even just plain notepad.

Example: sentence written with word:
The sky’s blue.



Written with notepad:
The sky's blue.


You see how the apostrophe is different? In some non-IE browsers, the Word choice for the apostrophe is not displayed properly.


With that said, one should never never use a word processor to write code :)
Go to Top of Page

KenW
Constraint Violating Yak Guru

391 Posts

Posted - 2008-02-25 : 15:49:46
quote:
Originally posted by megbot
With that said, one should never never use a word processor to write code :)



With that said, one should never use the word code to refer to markup.
Go to Top of Page

Ramdu
Starting Member

3 Posts

Posted - 2008-10-28 : 23:45:13
I am replying to this topic because it comes close to what I am trying to do.

I am a new web developer trying to put some marked up text from a products catalog into a SQL Server 2005 database table. The table has a column called prodFeatures that is text datatype.

I have copied the catalog information into Notepad. The text file looks similar to this:

Pump One
<h3>Features</h3>
</ul>
<li>asfsadfsfsff</li>
<li>asfdasdflkjlk;j</li>
<li>lcjvoisjwe</li>
<li>cvbbbfweer</li>
</ul>
PUmp One
<h3>Features</h3>
</ul>
<li>asfsadfsfsff</li>
<li>asfdasdflkjlk;j</li>
<li>lcjvoisjwe</li>
<li>cvbbbfweer</li>
</ul>

I want to copy the marked up text into the product features row, adding a row after each closing unordered list tag. I tried copying and pasting directly from Notepad into the row, but SQL Server only takes the first line (e.g. <h3>Features</h3>) and truncates the rest of my text.

HOw can I insert the marked up text into the table row without truncation? I want the <h3> and complete <ul> information for each product to be in one row.
Go to Top of Page

Ramdu
Starting Member

3 Posts

Posted - 2008-10-29 : 07:45:41
Can anyone help me solve this puzzle?
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-10-29 : 08:47:22
Sounds to me, as though you are using single line input for your textbox.

I dont think the problem is with sqlserver, change the textmode in your .net page to multiline. That hopefully should solve your mystery puzzle
Go to Top of Page

Ramdu
Starting Member

3 Posts

Posted - 2008-10-29 : 11:00:34
Thank you for responding to my question. I am not using .NET I am copying and pasting directly from Notepad into the SQL Server 2005 table. The text in Notepad is on multiple lines like I pasted above. When I copy an entire unordered list (which covers multiple lines in Notepad) and attempt to paste it into the SQL Server 2005 table, the table only takes the first line of my Notepad copied text (e.g. <h3>Features</h3>). It fails to copy the additional lines of text that I copied from Notepad. How do I get the table field to accept all of my copied text when I paste it??
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-10-29 : 11:05:53
quote:
Originally posted by Ramdu

Thank you for responding to my question. I am not using .NET I am copying and pasting directly from Notepad into the SQL Server 2005 table. The text in Notepad is on multiple lines like I pasted above. When I copy an entire unordered list (which covers multiple lines in Notepad) and attempt to paste it into the SQL Server 2005 table, the table only takes the first line of my Notepad copied text (e.g. <h3>Features</h3>). It fails to copy the additional lines of text that I copied from Notepad. How do I get the table field to accept all of my copied text when I paste it??



Honestly, I dont know about copying and pasting. Which was not the way data entry was designed in MS SQL, i thought it was in .net

Go to Top of Page

jahanzebnaeem
Starting Member

1 Post

Posted - 2011-04-29 : 05:59:18
Hello,

make it a multiline textbox by clicking this property of the textbox. only then you will be able to see all the lines in the textbox.
don't forget to resize the textbox.
Go to Top of Page
   

- Advertisement -