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

M

~Maheshkumar.R

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(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +723
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +196
salesfinal.sales_call_add1.MyInsertMethod_salescall(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.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277

------------------------------------------------------
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»
 
P

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.
 
M

~Maheshkumar.R

Thnkz, i 'm trying out that now..


PL said:
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
 
M

~Maheshkumar.R

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 said:
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
 
P

PL

~Maheshkumar.R said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top