Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Tags for this Thread

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    saransh mehta
    saransh mehta's Avatar
    Guest

    hi, i have a problem in adding value of HTML textarea in asp.net to SQL database?

    i have a problem in save the html textarea value in database. I add that HTML textbox in asp.net page due to some extra event in HTML textarea.
    my ASP code is that
    textarea id="COMMENTS" rows="2" cols="20" onKeyDown="textCounter(this.form.COMMENTS,this.for m.remLen,200);" onKeyUp="textCounter(this.form.COMMENTS,this.form. remLen,200);" onFocus="this.style.backgroundColor='#FFF9EC'" onBlur="this.style.backgroundColor='#ffffff'"></textarea>
    <input type="text" name="remLen" size="3" maxlength="3" value="200" readonly> <span class="catcntsml">Char count</span>

    and i want to add in that query to sql database
    SqlConnection conn = new SqlConnection(connstr);
    strsql = "insert into contactus values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + COMMENTS.textarea + "')";
    SqlCommand cmd = new SqlCommand(strsql, conn);
    conn.Open();
    cmd.CommandType = CommandType.Text;
    cmd.ExecuteNonQuery();
    conn.Close();


    plz solve my problem.....
    THANX

  2. #2
    Ahmad Al-Fakharany
    Ahmad Al-Fakharany's Avatar
    Guest
    try COMMENTS.textarea.value + "')";

 

 

Quick Reply Quick Reply

Click here to log in


What is the number after 87?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to connect Sql database in ASP.NET?
    By Saed G in forum Discuss ASP
    Replies: 1
    Last Post: 06-26-2011, 08:19 AM
  2. ASP.NET MS SQL database connectivity problem using IIS?
    By Mit Chauhan in forum Discuss ASP
    Replies: 0
    Last Post: 02-14-2011, 04:28 AM
  3. Replies: 0
    Last Post: 09-17-2009, 05:58 AM
  4. Replies: 0
    Last Post: 09-16-2009, 07:18 PM
  5. PHP/HTML form adding to SQL Database?
    By That's what she said in forum Discuss HTML
    Replies: 0
    Last Post: 05-15-2009, 09:44 PM

Bookmarks

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •