Friday, March 16, 2012

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(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
> --
> 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
This error is easy, a field in the database is not large enough, note that i
f 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 you
r data and then you should always check the length of
the data before trying to insert it.
PL.
"~Maheshkumar.R" <mfcmahesh@.hotmail.com> skrev i meddelandet news:OVKe0lrKFHA.3132@.TK2MSFTN
GP12.phx.gbl...
> The error i'm getting is as:
>
> --
Thnkz, i 'm trying out that now..
"PL" <pblse2@.yahoo.se> wrote in message
news:ulczWasKFHA.1096@.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" <mfcmahesh@.hotmail.com> skrev i meddelandet
news:OVKe0lrKFHA.3132@.TK2MSFTNGP12.phx.gbl...
>
-
>
Please dont mind, fill this box[ ] , how much it will hold, i mean size
limit.i'm 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" <pblse2@.yahoo.se> wrote in message
news:ulczWasKFHA.1096@.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" <mfcmahesh@.hotmail.com> skrev i meddelandet
news:OVKe0lrKFHA.3132@.TK2MSFTNGP12.phx.gbl...
>
-
>
check:-
http://www.functionx.com/sql/ or
http://www.microsoft.com/sql/default.mspx
Patrick
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!
Also try seeing this-
http://www.databasejournal.com/feat...cle.php/1442341 or
http://www.firebirdsql.org/manual/m...data-types.html
Hope it helps
PAtrick
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!
"~Maheshkumar.R" <mfcmahesh@.hotmail.com> skrev i meddelandet news:ecpKCstKFHA.1308@.TK2MSFTN
GP15.phx.gbl...
> Please dont mind, fill this box[ ] , how much it will hold, i mean size
> limit.i'm 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 pr
oblem is putting
too much text in some field, that's why you should always check the length b
efore inserting
or updating data even if you increase the size of your fields.
One should never assume people use things as intended :-)
PL.

0 comments:

Post a Comment