Одно из моих приложений работает с 2005 года. Теперь это дает ошибку, упомянутую ниже.Значение было слишком большим или слишком маленьким для Int16 через много лет
Я не знаю, что произошло. Кто-нибудь сталкивался с такой проблемой?
Server Error in '/' Application.
Value was either too large or too small for an Int16.
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.Exception: Value was either too large or too small for an Int16.
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:
[Exception: Value was either too large or too small for an Int16.]
Attach_DL.Generatekey() +121
Attach_BL.GenerateKey() +12
Picture.AddAttachments(String _attachpath, String _attachpathDB) +289
Picture.Btnsave_Click(Object sender, EventArgs e) +1416
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927
Я не могу вообще ничего рассказать из трассировки стека (т. е. обеспечить полезный код, на который ссылается трассировка стека). Я укажу, что максимальный размер для Int16 - '' 32767'' (положительный или отрицательный). Ваше приложение, в соответствии с stacktrace, пытается помещать нечто большее или меньшее, чем в переменную Int16. – Shadow
Возможно, поле, которое вы используете в своем приложении с типом данных Int16, превысило значение 32767. – Hakunamatata
Пожалуйста, отправьте исходный код 'Attach_DL.Generatekey()' –