.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 23rd, 2003, 07:11 PM
keith keith is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 2 keith User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
return a string from asp.net component

I am having a problem with returning a string from a component I wrote.. For example I can create this simple component and return a integer fine.<br><br><br>Imports system<br><br><br>Public Class retrnNames <br><br> dim strname1 as string<br> dim count1 as integer<br> Public function myname() as Integer<br> count1 = 150<br> return count1<br> end function<br> <br>end class<br><br><br>However if I try to return a string I get a error...(Input string was not in a correct format.)<br><br>Imports system<br><br><br>Public Class retrnNames <br><br> dim strname1 as string<br> dim count1 as integer<br> Public function myname() as string<br> strname1 = "Help!"<br> return strname1 <br> end function<br> <br>end class<br><br><br>Does anyone have any idea why I get this error??!??

Reply With Quote
  #2  
Old April 25th, 2003, 02:55 AM
MIB MIB is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 6 MIB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Is the code u gave to us exactly same as ur code?<br>I couldn't see any error in the sample u gave. <br><br>It looks like u are trying to get string from control or database by looking at error message.<br><br>Sorry cant help u much

Reply With Quote
  #3  
Old April 25th, 2003, 04:02 PM
keith keith is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 2 keith User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for your reply but I found the problem and I felt real dumb when I did. In the aspx file that I was using to call my component, I had not declared the variable as a string. I could have sworn I had checked that several times.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > return a string from asp.net component


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT