Loading ...

Tiny MCE: Load from database and save into database

Who is online?  0 guests and 0 members
home  »  forums   »  asp.net topics   »  getting started / general asp.net   » Tiny MCE: Load from database and save into database

Tiny MCE: Load from database and save into database

Posts under the topic: Tiny MCE: Load from database and save into database

Posted: 10/18/2010

Lurker 115  points  Lurker
  • Joined on: 10/11/2010
  • Posts: 15

Friends,

I want to save the content into the database from tinymce and load the content from database. Pls help me.

Suresh v


Posted: 10/19/2010

Starter 1414  points  Starter
  • Joined on: 12/1/2008
  • Posts: 66

 

vagaisuresh said:

user="suresh v"]

Friends,

I want to save the content into the database from tinymce and load the content from database. Pls help me.

Suresh v

 

 

Hello Suresh,

Try to do it like this.....In the markup write this

 <textarea id="txtTinyMCE" runat="server" name="txtTinyMCE" style="width: 95%; vertical-align: top; height: 400px;"></textarea>

and at cs side you just need to do it like this.

var test= new Test();
test.TinyMCEBody = txtTinyMCE.Value;
test.Name=txtName.Text;
...
...
...

add other properties and then save it to DB. Finally save it in DB by calling the AddNew() method. This is just an example.

TestRepository.AddNew(test);


For retreival you can do it like this.

string testID= Request.QueryString["testID"];

Test test= TestRepository.GetDetail(Convert.ToInt32(testID));

txtTinyMCE.Value = test.TinyMCEBody ;

I hope this is what you were looking for.


Thanks,

Sumit Arora

 


tags TinyMCE

Posted: 10/19/2010

Lurker 115  points  Lurker
  • Joined on: 10/11/2010
  • Posts: 15

 

SumitArora said:

user="Sumit Arora"]var test= new Test();

Hello Sumit Arora,

I am using VS2005. Not support for var in this version. Is any alternate method available?

Suresh


Posted: 10/19/2010

Starter 1414  points  Starter
  • Joined on: 12/1/2008
  • Posts: 66

vagaisuresh said:

user="suresh v"]

 

SumitArora said:

user="Sumit Arora"]var test= new Test();

Hello Sumit Arora,

I am using VS2005. Not support for var in this version. Is any alternate method available?

Suresh

 

 

Hello Suresh,

 

You can simple write it as :

Test test=new Test();

 

Thanks,

Sumit


Posted: 10/21/2010

Lurker 115  points  Lurker
  • Joined on: 10/11/2010
  • Posts: 15

Hello Friends,

Thanks. I found the solution with some research from above posts. But I have a problem during save the condent in Text Datatype.

                using (SqlCommand Cmd = DBConn.CreateCommand())
                {
                    Cmd.CommandText = "Insert into TEMPS (TempCode, TempHtmlBody) values (@TempCode, @TempHtmlBody)";

                    SqlParameter pTempHtmlBody = new SqlParameter("@TempHtmlBody", SqlDbType.Text, 16);
                    pTempHtmlBody.Value = TempHtmlBody;
                    pTempHtmlBody.Direction = ParameterDirection.Input;
                    Cmd.Parameters.Add(pTempHtmlBody);

Sixteen characters only saved.

Suresh


Posted: 10/25/2010

Lurker 115  points  Lurker
  • Joined on: 10/11/2010
  • Posts: 15

I required to save more than 8000 characters.

SqlParameter pNewsDescription = new SqlParameter("@NewsDescription", SqlDbType.VarChar, 8000);
Suresh


Posted: 10/25/2010

Lurker 115  points  Lurker
  • Joined on: 10/11/2010
  • Posts: 15
  Answered

Thank you.

Problem fixed. Laughing

cmd.Parameters.AddWithValue("@enm", txtEName.Text.Trim());

Suresh


Page 1 of 1 (7 items)