Click here to Skip to main content
16,004,919 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: ArrayList and Random Pin
demasoft24-Sep-07 8:26
demasoft24-Sep-07 8:26 
QuestionReturning a String() Array Pin
adhsys24-Sep-07 5:59
adhsys24-Sep-07 5:59 
AnswerRe: Returning a String() Array Pin
Luc Pattyn24-Sep-07 6:52
sitebuilderLuc Pattyn24-Sep-07 6:52 
QuestionWebsevice-method returnig a string() (array) : How to? Pin
adhsys24-Sep-07 5:53
adhsys24-Sep-07 5:53 
AnswerRe: Websevice-method returnig a string() (array) : How to? Pin
nlarson1124-Sep-07 7:24
nlarson1124-Sep-07 7:24 
AnswerRe: Websevice-method returnig a string() (array) : How to? Pin
Dave Kreskowiak24-Sep-07 8:00
mveDave Kreskowiak24-Sep-07 8:00 
GeneralRe: Websevice-method returnig a string() (array) : How to? Pin
nlarson1124-Sep-07 8:20
nlarson1124-Sep-07 8:20 
GeneralRe: Websevice-method returnig a string() (array) : How to? Pin
Dave Kreskowiak24-Sep-07 10:41
mveDave Kreskowiak24-Sep-07 10:41 
I can't see the error you posted, probably because it's wrapped in tags and you didn't check the "Ignore HTML tags in this message" checkbox before you hit "Post Message".

But, in any case, the code, as you posted it, DOES work.

This sample was done under VS2005, modified for .NET 3.0 and WCF extensions. See if you can guess which method will fail and why?
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
 
<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class Service1
    Inherits System.Web.Services.WebService
 
    <WebMethod()> _
    Public Function GetArrayOfStrings() As String()
        Dim strings As String() = {"Some text 1", "Some text 2", "Some text 3"}
 
        return strings
    End Function
 
    <WebMethod()> _
    Public Function GetArrayOfStrings2() As String()
        Dim strings(3) As String
 
        strings(0) = "Some text 1"
        strings(1) = "Some text 2"
        strings(2) = "Some text 3"
 
        return strings
    End Function
 
    <WebMethod()> _
    Public Function GetArrayListOfStrings() As ArrayList
        Dim list As New ArrayList
        list.AddRange(New String() {"Some text 1", "Some text 2", "Some text 3"})
 
        return list
    End Function
 
    <WebMethod()> _
    Public Function GetListOfStrings() As List(Of String)
        Dim list As New List(Of String)
        list.AddRange(New String() {"Some text 1", "Some text 2", "Some text 3"})
 
        return list
    End Function
End Class





A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: Websevice-method returnig a string() (array) : How to? Pin
nlarson1125-Sep-07 3:56
nlarson1125-Sep-07 3:56 
GeneralRe: Websevice-method returnig a string() (array) : How to? Pin
Dave Kreskowiak25-Sep-07 12:53
mveDave Kreskowiak25-Sep-07 12:53 
GeneralRe: Websevice-method returnig a string() (array) : How to? Pin
nlarson1126-Sep-07 3:48
nlarson1126-Sep-07 3:48 
GeneralRe: Websevice-method returnig a string() (array) : How to? Pin
Dave Kreskowiak26-Sep-07 12:30
mveDave Kreskowiak26-Sep-07 12:30 
AnswerRe: Websevice-method returnig a string() (array) : How to? Pin
kubben24-Sep-07 8:39
kubben24-Sep-07 8:39 
Questiondisplay a picture in crystal report from a database Pin
steve_rm24-Sep-07 4:49
steve_rm24-Sep-07 4:49 
AnswerRe: display a picture in crystal report from a database Pin
prasuaaron14-Nov-07 23:38
prasuaaron14-Nov-07 23:38 
GeneralRe: display a picture in crystal report from a database Pin
prasuaaron14-Nov-07 23:39
prasuaaron14-Nov-07 23:39 
QuestionSOftware of server & clients Pin
ankur010124-Sep-07 3:19
ankur010124-Sep-07 3:19 
AnswerRe: SOftware of server & clients Pin
DigiOz Multimedia24-Sep-07 4:12
DigiOz Multimedia24-Sep-07 4:12 
Questiondatagrid in vb.net 2003 Pin
prasuaaron24-Sep-07 3:03
prasuaaron24-Sep-07 3:03 
AnswerRe: datagrid in vb.net 2003 Pin
DigiOz Multimedia24-Sep-07 4:25
DigiOz Multimedia24-Sep-07 4:25 
QuestionAccess Pin
mcbunnell24-Sep-07 3:01
mcbunnell24-Sep-07 3:01 
AnswerRe: Access Pin
Kschuler24-Sep-07 4:01
Kschuler24-Sep-07 4:01 
GeneralRe: Access Pin
mcbunnell24-Sep-07 6:53
mcbunnell24-Sep-07 6:53 
GeneralRe: Access Pin
Kschuler24-Sep-07 8:02
Kschuler24-Sep-07 8:02 
AnswerRe: Access Pin
Dave Kreskowiak24-Sep-07 5:01
mveDave Kreskowiak24-Sep-07 5:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.