SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Hi Newbie here

  1. #1
    SitePoint Member
    Join Date
    Mar 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hi Newbie here

    Hi
    I kee getting this error from my msdb, i am not to sure as to how to proceed any help welcome.


    Code ASP:
    NSERT INTO UserT (FirstName,LastName, CompanyName, eMail, Phone,Mobile, Fax, Address1, Address2, Region, City, zipCode, countryID, promotionCode, LoginName, Password,userTitleID,Status,Owner,DateCreated,LastVisit) 
    VALUES('*******','','dereo@gmail.com','00442920689666','','','' ,'' ,'','','null',246 ,null ,'panoramanew','3D4F2BF07DC1BE38B20CD6E46949A1071F9D0E3D',1,0,2,getDate(),getDate())
    System.Data.SqlClient.SqlException: String or binary data would be truncated. The statement has been terminated. 
    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) 
    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) 
    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) 
    at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) 
    at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) 
    at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) 
    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() 
    at MyFunc.Functions.ExecuteSQL(String str_sql) in c:\inetpub\vhosts\*******.co.uk\********\App_Code\Functions.cs:line 188
    DB ERROR occured
    Last edited by Mittineague; Mar 17, 2013 at 21:54. Reason: reformatting bbcode tags

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)
    Hi moggy4, welcome to the forums,

    My guess is the key portion of interest in that rather long message is
    "String or binary data would be truncated"

    i.e. One (and maybe others?) of the VALUES you are trying to INSERT into a field is too long.

    Check your SCHEMA against those values and you should hopefully be able to spot it.

  3. #3
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Is that .NET code rather than classic ASP?
    Ian Anderson
    www.siteguru.co.uk

  4. #4
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by siteguru View Post
    Is that .NET code rather than classic ASP?


    It definitely is .net

  5. #5
    SitePoint Member
    Join Date
    Jan 2014
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For starters you have 21 fields defined in insert statement but only 20 values provided.
    Right now you trying to insert email into company name and so on.
    As result your LoginName, Password, will be like that:
    3D4F2BF07DC1BE38B20CD6E46949A1071F9D0E3D',1,
    Very good password(1), LoginName is the field where binary data has been truncated.
    And second issue has been pointed earlier, either go to SQL forum or .NET forum...
    This forum is for Classic ASP issues.
    Cheers.


Bookmarks

Posting Permissions

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