SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: Hi Newbie here
-
Mar 17, 2013, 11:24 #1
- 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 22:54. Reason: reformatting bbcode tags
-
Mar 17, 2013, 23:07 #2
- 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.Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
-
Mar 19, 2013, 09:13 #3
- 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?
-
Mar 24, 2013, 08:40 #4
- Join Date
- Jul 2004
- Location
- Nigeria
- Posts
- 1,737
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jan 31, 2014, 13:32 #5
- 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