Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / April 2005

Tip: Looking for answers? Try searching our database.

Error: System.ArgumentException: Cannot convert  to System.Int32.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Simon Harris - 27 Apr 2005 17:20 GMT
I have created a web service, which when I call in my browser presents the
text form etc. When I click the button, I get this error:

System.ArgumentException: Cannot convert  to System.Int32.
Parameter name: type ---> System.FormatException: Input string was not in
a
correct format.
  at System.Number.ParseInt32(String s, NumberStyles style,
NumberFormatInfo info)
  at System.String.System.IConvertible.ToInt32(IFormatProvider provider)
  at System.Convert.ChangeType(Object value, Type conversionType,
IFormatProvider provider)
  at System.Web.Services.Protocols.ScalarFormatter.FromString(String
value,
Type type)
  --- End of inner exception stack trace ---
  at System.Web.Services.Protocols.ScalarFormatter.FromString(String
value,
Type type)
  at
System.Web.Services.Protocols.ValueCollectionParameterReader.Read(NameValu
eCollection
collection)
  at
System.Web.Services.Protocols.HtmlFormParameterReader.Read(HttpRequest
request)
  at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
  at System.Web.Services.Protocols.WebServiceHandler.Invoke()
  at
System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()This
seems to happen only when I have parameters of different data types, e.g.:

Works:
======
<WebMethod()> _
Public Function GetAddresses(ByVal a As String, ByVal b As String) As
DataSet

Causes Error:
===========
<WebMethod()> _
Public Function GetAddresses(ByVal a As String, ByVal b As Integer) As
DataSet

Any ideas/suggestions will be much appreciated.

Regards,

Simon.

--
I am using the free version of SPAMfighter for private users.
It has removed 2052 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!
Simon Harris - 27 Apr 2005 21:54 GMT
Solved it - Its because my parameter of Integer type did not have a value
when I called the function.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.