Textarea to sql 2000 text datatype

A

adrianca

Hi All,
Does anyone have any example of asp.net code for saving a
textarea into a text/ntext column in sql table?

thanks

slyi
 
G

Grant Merwitz

Shouldn't be any different to storing any other type of data.
Are you having problems testing this normally?

Just create a Stored Procedure to do it, and set the parameter.
Worked for me

HTH

My Example:

*****************
Sql
******************

CREATE PROCEDURE [spname]
@MyNTextParam NTEXT
AS

INSERT INTO MYTABLE VALUES(@MyNTextParam)


*************
c#
*************

SqlCommand cmd = new SqlCommand([spname], [connectionstring]);
cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.add(new SqlParameter("@MyNTextParam". SqlDbType.NText)).Value
= MyTextArea.Text;

//Open connection and execite cmd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top