470,619 Members | 1,463 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,619 developers. It's quick & easy.

Please help me to find out the reason for this error in ASP>NET page ????

The error i'm getting is as:

Server Error in '/' Application.
-------------------------------------------------------------------------- -- String or binary data would be truncated. The statement has been
terminated.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: String or binary
data would be truncated. The statement has been terminated.

Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:
[SqlException: String or binary data would be truncated.
The statement has been terminated.]
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +723
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +196 salesfinal.sales_call_add1.MyInsertMethod_salescal l(Int32 cALL_ID, Int32 cALL_TYPE, String cLT_NAME, String cLT_ADD, String cLT_TEL, DateTime
cALL_DATE, Int32 sECTOR, String pER_CNT_NAME, String pER_CNT_DESG, Int32
iNIT_BY, Int32 cLT_AWARE_SIS, Int32 cLT_REQ_SECURITY, Int32 sTR_REQ, Int32
mEETING_SCHEDULED, Int32 fOLL_SCHEDULED, DateTime mEET_FOLL_DATE, String
rEMARKS, Int32 qUALIFY_PCL, Int32 rEASON_NOT_QUALITY, String e_ID, String
b_ID) salesfinal.sales_call_add1.Button1_Click(Object sender, EventArgs e)
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
----
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573


------------------------------------------------------
I have testted this appln and uploaded it. but now i'm getting complaint
from an user of this app. Rest of them are satisfied and said working fine.
1. Few things i'm storing in session and passion as paramter to this
function MyInsertMethod_salescall( ...para.1.2.3..etc). This function is
called in the button click event, which insert into DB.
thnkz,
Mahesh kumar.R
--b--r--*-f-r---K
Nov 19 '05 #1
6 3219
PL


This error is easy, a field in the database is not large enough, note that if you for example create a varchar field you only get 50
characters per default, you have to change it to be large enough to hold your data and then you should always check the length of
the data before trying to insert it.

PL.
"~Maheshkumar.R" <mf*******@hotmail.com> skrev i meddelandet news:OV**************@TK2MSFTNGP12.phx.gbl...
The error i'm getting is as:

Server Error in '/' Application.
--------------------------------------------------------------------------

--
String or binary data would be truncated. The statement has been
terminated.

Nov 19 '05 #2
Thnkz, i 'm trying out that now..
"PL" <pb****@yahoo.se> wrote in message
news:ul**************@tk2msftngp13.phx.gbl...


This error is easy, a field in the database is not large enough, note that if you for example create a varchar field you only get 50 characters per default, you have to change it to be large enough to hold your data and then you should always check the length of the data before trying to insert it.

PL.
"~Maheshkumar.R" <mf*******@hotmail.com> skrev i meddelandet

news:OV**************@TK2MSFTNGP12.phx.gbl...
The error i'm getting is as:

Server Error in '/' Application.
-------------------------------------------------------------------------

- --
String or binary data would be truncated. The statement has been
terminated.


Nov 19 '05 #3
Please dont mind, fill this box[ ] , how much it will hold, i mean size
limit.i'm confused about length and size.

column name - datatype - length
-----------------------------------------------
CALL_ID smallint 2 [ * ]
CALL_TYPE tinyint 1 [ ]
CLT_NAME char 75 [ ]
CLT_ADD char 300[ ]
CLT_TEL char 50 [ ]
CALL_DATE smalldatetime 4 [ ] * format
please
SECTOR tinyint 1 [ ]
PER_CNT_NAME char 30 [ ]
PER_CNT_DESG char 30 [ ]
INIT_BY tinyint 1 [ ]
CLT_AWARE_SIS tinyint 1
CLT_SECURITY tinyint 1
STR_REQ tinyint 1
MEETING_SCHEDULEDtinyint 1
FOLL_SCHEDULED tinyint 1
MEET_FOLL_DATE datetime 8 [ ]
REMARKS char 300 [ ]
QUALIFY_PCL tinyint 1 [ ]
REASON_QUALITY tinyint 1
E_ID char 10 [ ]
B_ID char 10 [ ]
send me any link to study about this Sql database type, length etc...
thkz very much,
Mahes


"PL" <pb****@yahoo.se> wrote in message
news:ul**************@tk2msftngp13.phx.gbl...


This error is easy, a field in the database is not large enough, note that if you for example create a varchar field you only get 50 characters per default, you have to change it to be large enough to hold your data and then you should always check the length of the data before trying to insert it.

PL.
"~Maheshkumar.R" <mf*******@hotmail.com> skrev i meddelandet

news:OV**************@TK2MSFTNGP12.phx.gbl...
The error i'm getting is as:

Server Error in '/' Application.
-------------------------------------------------------------------------

- --
String or binary data would be truncated. The statement has been
terminated.


Nov 19 '05 #4
check:-
http://www.functionx.com/sql/ or
http://www.microsoft.com/sql/default.mspx
Patrick


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #5
Also try seeing this-
http://www.databasejournal.com/featu...le.php/1442341 or
http://www.firebirdsql.org/manual/mi...ata-types.html

Hope it helps
PAtrick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #6
PL

"~Maheshkumar.R" <mf*******@hotmail.com> skrev i meddelandet news:ec**************@TK2MSFTNGP15.phx.gbl...
Please dont mind, fill this box[ ] , how much it will hold, i mean size
limit.i'm confused about length and size.


It all depends on what you want to store, there is no fixed size that works for every case,
the error you are getting indicates it's string data so look into your char and varchar fields.

What is happening is simply that the one user you mentioned that had this problem is putting
too much text in some field, that's why you should always check the length before inserting
or updating data even if you increase the size of your fields.

One should never assume people use things as intended :-)

PL.
Nov 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Raghu | last post: by
3 posts views Thread by Goran Djuranovic | last post: by
5 posts views Thread by Adam | last post: by
6 posts views Thread by Jason Chu | last post: by
4 posts views Thread by aze | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.