troubleshooting Question

Finding problem using stack trace in vb.net

Avatar of OB1Canobie
OB1CanobieFlag for United States of America asked on
Software.NET ProgrammingASP.NET
2 Comments1 Solution1233 ViewsLast Modified:
I have a web page for asp.net programmed in vb.net. I am getting an error when testing a form submitting data to an SQL Server 2008 database. I'm having issues finding the exact place where the error is occurring. I know the issue is a conversion problem, but I can't seem to understand the stack trace info to point me to the line or parameter or object causing this. This normally would not be an issue but I have over 79 parameters being fed to the database through a stored procedure. I am copying the error information below.

System.FormatException was caught
  Message="Failed to convert parameter value from a String to a Int64."
  Source="System.Data"
  StackTrace:
       at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType)
       at System.Data.SqlClient.SqlParameter.GetCoercedValue()
       at System.Data.SqlClient.SqlParameter.Validate(Int32 index, Boolean isCommandProc)
       at System.Data.SqlClient.SqlCommand.SetUpRPCParameters(_SqlRPC rpc, Int32 startCount, Boolean inSchema, SqlParameterCollection parameters)
       at System.Data.SqlClient.SqlCommand.BuildRPC(Boolean inSchema, SqlParameterCollection parameters, _SqlRPC& rpc)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery(AsyncCallback callback, Object stateObject)
       at System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery()
       at Xamine_Web.account_credit_application.update_Client_Credit_Application() in C:\Documents and Settings\Stacey W. Fontenot\My Documents\Visual Studio 2008\Projects\1009_Xamine_Web\Xamine_Web\myaccount\account_credit_application.aspx.vb:line 1632
  InnerException: System.FormatException
       Message="Input string was not in a correct format."
       Source="mscorlib"
       StackTrace:
            at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
            at System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt)
            at System.String.System.IConvertible.ToInt64(IFormatProvider provider)
            at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
            at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType)
       InnerException:
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros