as String... Function for DataSource ?

Discussion in 'ASP .Net' started by Adrian Turner, Sep 29, 2009.

  1. Hi, I have used this simple approach to build a dropdown control.

    Dim Times() as string = {"00:00","00:15"}
    Times1.Datasource=Times:Times1.Databind()

    What I'm wondering if I can do something like...
    Dim Times() as string = {BuildTimes()}

    It doesnt seem to work. I dont know if the syntax I'm using is incorrect, or
    if it's just not possible. Any help would be appreciated.
    Adrian Turner, Sep 29, 2009
    #1
    1. Advertising

  2. I think I might be doing it incorrect. I am using Function BuildTimes() as
    String.
    I have tried removing the Brackets an it errors. Is a String Array different ?

    regards,

    Adrian

    "Mark Rae [MVP]" wrote:

    > "Adrian Turner" <> wrote in message
    > news:...
    >
    > > Hi, I have used this simple approach to build a dropdown control.
    > >
    > > Dim Times() as string = {"00:00","00:15"}
    > > Times1.Datasource=Times:Times1.Databind()
    > >
    > > What I'm wondering if I can do something like...
    > > Dim Times() as string = {BuildTimes()}
    > >
    > > It doesnt seem to work. I dont know if the syntax I'm using is incorrect,
    > > or
    > > if it's just not possible. Any help would be appreciated.

    >
    > Is BuildTimes() a function which returns a string array? If so, then you
    > don't need the brackets...
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
    >
    >
    Adrian Turner, Sep 29, 2009
    #2
    1. Advertising

  3. Thanks for you help. I will look at what you sent, but I just used split and
    it works fine. Thanks.

    "Mark Rae [MVP]" wrote:

    > "Adrian Turner" <> wrote in message
    > news:...
    >
    > [please don't top-post]
    > http://www.caliburn.nl/topposting.html
    >
    >
    > >> Is BuildTimes() a function which returns a string array? If so, then you
    > >> don't need the brackets...

    > >
    > >I think I might be doing it incorrect. I am using Function BuildTimes() as
    > > String. I have tried removing the Brackets an it errors. I

    >
    > And what is the error...?
    >
    >
    > > Is a String Array different ?

    >
    > Is a string array different from a string? Well, yes it is:
    > http://www.google.co.uk/search?hl=en&q=vb.net array of strings&meta=&aq=3&oq="VB.NET" array
    >
    > However, there is little (if any) difference between "Dim v As String()" and
    > "Dim v() As String"
    > http://stackoverflow.com/questions/...e-between-dim-v-as-string-and-dim-v-as-string
    >
    > Please bottom-post the entire BuildTimes() function.
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
    >
    >
    Adrian Turner, Sep 29, 2009
    #3
  4. Adrian Turner

    Jeff Johnson Guest

    "Mark Rae [MVP]" <> wrote in message
    news:%23cov%...

    >> Hi, I have used this simple approach to build a dropdown control.
    >>
    >> Dim Times() as string = {"00:00","00:15"}
    >> Times1.Datasource=Times:Times1.Databind()
    >>
    >> What I'm wondering if I can do something like...
    >> Dim Times() as string = {BuildTimes()}


    > Is BuildTimes() a function which returns a string array? If so, then you
    > don't need the brackets...


    Specifically, you don't need the BRACES. Our British friends will disagree,
    but I say there are no brackets in

    Dim Times() as string = {BuildTimes()}

    just parentheses and braces.
    Jeff Johnson, Sep 29, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    2,059
  2. James Vanns
    Replies:
    7
    Views:
    7,010
    Evan Carew
    Jan 21, 2004
  3. Replies:
    1
    Views:
    2,537
    =?Utf-8?B?Y2xpY2tvbg==?=
    May 17, 2006
  4. Jim McGivney
    Replies:
    1
    Views:
    442
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Sep 3, 2006
  5. =?ISO-8859-1?Q?Martin_J=F8rgensen?=
    Replies:
    5
    Views:
    1,274
    =?ISO-8859-1?Q?Martin_J=F8rgensen?=
    May 6, 2006
Loading...

Share This Page