473,395 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Input string was not in the correct format

4
Hiya Folks,

I am Currently using windows xp. Also using Visual Web Developer 2005 and Microsoft Sql server 2005.
The main page consists of an aspx page and a master page.
The page also consists of a label control(hidden when run in browser).
Also an Sql data source control connected to database tables for a photo album.
Also label web control ID=UserIdValue.
Also a Details View control ID=dvPictureInsert
Problem is how to work out what an “Unhandled exception “is and how to work out what
“Input string was not in a correct format” is.
When I put a category, Id and description values on my website and click on the insert hyperlink you get the “Input string was not in the correct format”.
Input string was not in a correct format. It would be appreciated if someone could explain how to read and understand the unhandled exception below.

Below is the unhandled exception
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.FormatException: Input string was not in a correct format.

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:
Expand|Select|Wrap|Line Numbers
  1. [FormatException: Input string was not in a correct format.]
  2. System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2752899
  3. System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +102
  4. System.String.System.IConvertible.ToInt32(IFormatProvider provider) +43
  5. System.Convert.ChangeType(Object value, TypeCode typeCode, IFormatProvider provider) +293
  6. System.Web.UI.WebControls.Parameter.GetValue(Object value, String defaultValue, TypeCode type, Boolean convertEmptyStringToNull, Boolean ignoreNullableTypeChanges) +248
  7. System.Web.UI.WebControls.SqlDataSourceView.AddParameters(DbCommand command, ParameterCollection reference, IDictionary parameters, IDictionary exclusionList, String oldValuesParameterFormatString) +547
  8. System.Web.UI.WebControls.SqlDataSourceView.ExecuteInsert(IDictionary values) +304
  9. System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) +68
  10. System.Web.UI.WebControls.DetailsView.HandleInsert(String commandArg, Boolean causesValidation) +394
  11. System.Web.UI.WebControls.DetailsView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +609
  12. System.Web.UI.WebControls.DetailsView.OnBubbleEvent(Object source, EventArgs e) +88
  13. System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
  14. System.Web.UI.WebControls.DetailsViewRow.OnBubbleEvent(Object source, EventArgs e) +109
  15. System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
  16. System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +85
  17. System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +153
  18. System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
  19. System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
  20. System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +170
  21. System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4921
  22.  
  23.  
  24. Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
  25.  
  26.  
  27. Below is the event handler source code
  28.  
  29. Partial Class PhotoAdmin_Default
  30. Inherits System.Web.UI.Page
  31.  
  32. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  33. UserIdValue.Text = Membership.GetUser().ProviderUserKey.ToString()
  34.  
  35.  
  36. End Sub
  37.  
  38. Protected Sub dvPictureInsert_ItemInserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewInsertEventArgs) Handles dvPictureInsert.ItemInserting
  39. e.Values("UserId") = Membership.GetUser().ProviderUserKey
  40. e.Values("UploadedOn") = DateTime.Now
  41.  
  42. End Sub
  43. End Class
  44.  
Mar 21 '07 #1
0 3146

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jim | last post by:
im using asp.net, C# to enter data into a table in sql server...however im getting this error: Input string was not in a correct format. Description: An unhandled exception occurred during the...
0
by: lianfe_ravago | last post by:
Input string was not in a correct format. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the...
5
by: blackg | last post by:
Input string not in correct format -------------------------------------------------------------------------------- I am trying to view a picture from a table. I am getting this error Input string...
1
by: amitbadgi | last post by:
Welcome back amitbadgi | Logout | Faq Knowledge Discovery Keys COMPUTER PROGRAMMING, DATA MINING, STATISTICS, ARTIFICIAL INTELLIGENCE * Settings * Photos * Lists * MVPs * Forums * Blogs
1
by: amitbadgi | last post by:
I am gettign this error, while migration an app to asp.net Exception Details: System.FormatException: Input string was not in a correct format. Source Error: Line 19: Dim enddate =...
0
by: hudhuhandhu | last post by:
have got an error which says Input string was not in a correct format. as follows.. Description: An unhandled exception occurred during the execution of the current web request. Please review the...
0
by: Anonieko | last post by:
Are there any javascript codes there? Answer: Yes On the PageLoad event call InitialClientControsl as follows /// <summary> /// This will add client-side event handlers for most of the...
1
by: sehguh | last post by:
Hello folks I have recently been studying a book called "sams teach yourself asp.net 2.0 in24 hours by scott mitchell. I have reached page 614 but when i tried to run an asp page called...
1
by: differentsri | last post by:
THIS IS AN ASP.NET 1.1 APPLICATION IAM TRYING TO UPDATE THE FIELD BUT I AM NOT ABLE TO UPDATE IT? CAN U TELL THE REASON ? IT IS GIVING THE FOLLOWING ERROR BELOW I HAVE ALSO GIVEN THE CODE OF...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.