Posted: 10/18/2010
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
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
user="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
SumitArora said: user="Sumit Arora"]var test= new Test();
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
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
You can simple write it as :
Test test=new Test();
Sumit
Posted: 10/21/2010
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.
Posted: 10/25/2010
I required to save more than 8000 characters.
SqlParameter pNewsDescription = new SqlParameter("@NewsDescription", SqlDbType.VarChar, 8000);
Thank you.
Problem fixed.
cmd.Parameters.AddWithValue("@enm", txtEName.Text.Trim());