---
title: "can't store value of text area in database in comment column it store multiline?"  
description: "can't store value of text area in database in comment column it store multiline?"  
author: "Anonymous User"  
published: 2014-12-22  
updated: 2014-12-23  
canonical: https://www.mindstick.com/forum/12807/can-t-store-value-of-text-area-in-database-in-comment-column-it-store-multiline  
category: "asp.net"  
tags: ["c#"]  
reading_time: 1 minute  

---

# can't store value of text area in database in comment column it store multiline?

[HTML](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript) code

<[textarea](https://www.mindstick.com/forum/155821/how-we-will-generate-textarea-control-using-htmlhelper-in-razor-view) id="commentarea" [name](https://yourviews.mindstick.com/view/87450/how-to-generate-a-brand-name-using-linkedin-comprehensive-guide)="S1" cols="30" rows="5"></textarea>

**[C# code](https://www.mindstick.com/forum/403/how-to-export-data-in-excel-file-from-sql-server-using-c-sharp-code)**

```
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["RegistrationConnectionString"].ConnectionString); conn.Open(); string insertcmnt = "insert into Comment(Comment)
values(@comment)";    SqlCommand com = new
SqlCommand(insertcmnt, conn);        com.Parameters.AddWithValue("@comment",
TextBoxMode.MultiLine.ToString());        com.ExecuteNonQuery();        Response.Write("Commented
successfully");        conn.Close();
```

## Replies

### Reply by Anonymous User

Hi jai

You are storing the name of the MultiLine value from the TextBoxMode enum. You should be referencing the textarea object. Try this

com.Parameters.AddWithValue("@comment", commentarea.Text);

Also, the textarea in the html is missing the runat attribute

<textarea id="commentarea" name="S1" cols="30" rows="5" runat="server"></textarea>


---

Original Source: https://www.mindstick.com/forum/12807/can-t-store-value-of-text-area-in-database-in-comment-column-it-store-multiline

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
