Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8434949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:47:53+00:00 2026-06-10T06:47:53+00:00

On inserting the date via asp.net to SQL Server 2008 an error is happening.

  • 0

On inserting the date via asp.net to SQL Server 2008 an error is happening.

Insert statement

Insert into comment(CommentFrom, CommentTo, Comment, Cmntonscrap, Cmnttime) 
Values('" + Session["UserName"] + "','" + email.Text.ToString() + "','"  + 
       txt.Text.ToString().Trim() + "','" + cscrap.Text.ToString().Trim()  + 
       "','" + DateTime.Now.ToString().Trim() + "')";

Error:

string or binary data would be truncated,Statement is terminating

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:47:54+00:00Added an answer on June 10, 2026 at 6:47 am

    Your problem is not with the date.
    Its with the string data being too large for a column(probably a varchar), that you are trying to insert the data into.

    I would check the length of your Comment and txt.Text and see that the data can be inserted.

    Use a sql type datetime for your DateTime. Storing dates in a text column is inviting a lot of trouble.

    • It takes more storage space.
    • Searching through that data will be really difficult.
    • You will never be able to change timezones.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

when i'm inserting data to the sql server 2008 database through asp.net application date
I have this SQL statement below INSERT into 2011_electricity ( date, energy, daynum) VALUES
I'm using ASP.NET/VB and I'm trying to insert a date and time into an
I have problem when inserting a date to my database Insert query: INSERT INTO
I have a php script inserting values in to SQL Server 2005 table via
I'm inserting a row into a table, like so: mysql_query(INSERT INTO post(name,message,date)VALUES('$name','$message','$date')); The table
I am using Java JDBC to write a date to SQL server 2008 and
When inserting values into TARGET_TABLE with below INSERT..SELECT statement, the column default for the
I am inserting a date into my database, the value which comes from: s.theDate
I'm using oracle 11g. I'm inserting date and time using function SYSDATE into column

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.