Results 1 to 5 of 5

Thread: Cookies question

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Cookies question

    Using the following I can create a cookie :

    Dim mycookie As New HttpCookie("Userinfo")

    mycookie("Name") = "Whatever"
    mycookie("City") = "Whatever ..."

    e.t.c.

    How would I declare this if the value "mycookie" is in fact stored in a variable.

    e.g
    dim myvar as string
    myvar = "mycookie"

    dim myvar as new HttpCookie("Userinfo") will kick up a stink.

    Any ideas geniuses
    Cheers

    Parksie

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You are trying to cast from a string to an HttpCookie object. myvar should be declared as a cookie.

  3. #3

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018
    You have lost me a bit Eednis.

    When the user opens a particular detail page I query the database and return the detail record.
    One of the fields in my database is called pageName.
    I need to create a cookie named after the contents of this field.

    e.g "page1" or "detailpage" which is held in pageName.

    Thanks so far.

    This .net stuff really is starting to sink in now.
    I can rightfully say that apart from Crystal reports and Package and Deployment, I love .net.

    Parksie

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    A Cookie is a collection type object so it can't be stored in a string (its stored in the cookie). So if you want to create a cookie NAMED after a field then use the string as the name instead of assigning the string to the cookie. But I'm not really sure I understand what you are trying to do, maybe somehting like this:
    VB Code:
    1. dim myvar as string="mycookie"
    2.  
    3. dim myCookie as new HttpCookie(myvar)

  5. #5
    Lively Member
    Join Date
    Sep 2003
    Location
    Chicago, IL
    Posts
    64
    Crystal reports is bad ass, once you get it figured out. Check out the post I recently made about it. I outlined how to do it so it works every time. It outlines parameter passing, authentication, etc. CR works great after you understand it.
    Mike Stammer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width