Click here to Skip to main content
15,881,612 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to insert data from richtext editor to database. All columns insert but richtext editor is null. The data type of richtexteditor column-
nvarchar(max). id of richtexteditor is rte1. Here is my code:
C#
protected void btnsubmit_Click(object sender, EventArgs e)
  {
      using (DataClassesDataContext context = new DataClassesDataContext())
      {
          obimot customer = new obimot
          {
              Subject = TextBox1.Text,
              pname = TextBox2.Text,
              mobileno = TextBox3.Text,

              pprofession = TextBox4.Text,
              Description =Rte1.Text,

          };
          context.obimots.InsertOnSubmit(customer);
          context.SubmitChanges();
      }

Please help me. I am in big trouble.
Posted
Updated 8-Jun-10 1:41am
v2

1 solution

This code seems to be ok. Check you db paramete and parameter type and also check your stored procedure. You might be using incorrect type or assigning incorrect value to the column.
 
Share this answer
 
Comments
mobasshir 8-Jun-10 5:56am    
my data type- nvarchar(max), what is wrong ? i want to insert value from text editor.
PSK_ 8-Jun-10 6:13am    
nvarchar(MAX) is perfectly fine for storing long text. Check Rte1.Text is getting value and you are properly passing this value to you SP. Use debugging to track the value.
mobasshir 8-Jun-10 7:12am    
dear, i can not understand the problem. please send me little project with text editor that insert value. database will be present in app folder.we use this this text editor -http://rte.codeplex.com. this is my email address mobasshirice@gmail.com. please kindly help me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900