Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Datetime/Integer error

Datetime/Integer error

Scheduled Pinned Locked Moved Visual Basic
helpquestionhtmldatabaseannouncement
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aqzman_
    wrote on last edited by
    #1

    Hi guys, I'm having a pretty simple problem, but I guess I don't have the skill to solve it yet. I've wrote a string to get information from a database and put it into a label, all of that works fine but one of the fields is an Integer, and another is a datetime, so where I'm using "+"s it gives me an error, how can I solve this? Here is a shorted version of the line of code. txtMenu = txtMenu + "" + "" + " User's ID " + usrid + "" + "" + " State is " + State + "" + "" + " Date Opened was " + dateopen + "" + "" The HTML code is just for setting up a table, the error occurs between 'usrid' and 'dateopen', atleast, that's my best guess. Here is the exact error I get: "Operator '+' is not defined for types 'Double' and 'Date'.". Any suggestions would be a big help. Thanks, aqzman

    T S 2 Replies Last reply
    0
    • A aqzman_

      Hi guys, I'm having a pretty simple problem, but I guess I don't have the skill to solve it yet. I've wrote a string to get information from a database and put it into a label, all of that works fine but one of the fields is an Integer, and another is a datetime, so where I'm using "+"s it gives me an error, how can I solve this? Here is a shorted version of the line of code. txtMenu = txtMenu + "" + "" + " User's ID " + usrid + "" + "" + " State is " + State + "" + "" + " Date Opened was " + dateopen + "" + "" The HTML code is just for setting up a table, the error occurs between 'usrid' and 'dateopen', atleast, that's my best guess. Here is the exact error I get: "Operator '+' is not defined for types 'Double' and 'Date'.". Any suggestions would be a big help. Thanks, aqzman

      T Offline
      T Offline
      Tom Deketelaere
      wrote on last edited by
      #2

      use '&' instead of '+' in vb.net '+' has the math value

      A 1 Reply Last reply
      0
      • T Tom Deketelaere

        use '&' instead of '+' in vb.net '+' has the math value

        A Offline
        A Offline
        aqzman_
        wrote on last edited by
        #3

        Worked like a charm, I knew it was only simple. I tried "+ & usrid & +" too, haha. Thanks a lot for the help!

        1 Reply Last reply
        0
        • A aqzman_

          Hi guys, I'm having a pretty simple problem, but I guess I don't have the skill to solve it yet. I've wrote a string to get information from a database and put it into a label, all of that works fine but one of the fields is an Integer, and another is a datetime, so where I'm using "+"s it gives me an error, how can I solve this? Here is a shorted version of the line of code. txtMenu = txtMenu + "" + "" + " User's ID " + usrid + "" + "" + " State is " + State + "" + "" + " Date Opened was " + dateopen + "" + "" The HTML code is just for setting up a table, the error occurs between 'usrid' and 'dateopen', atleast, that's my best guess. Here is the exact error I get: "Operator '+' is not defined for types 'Double' and 'Date'.". Any suggestions would be a big help. Thanks, aqzman

          S Offline
          S Offline
          Senthil S
          wrote on last edited by
          #4

          Hello, Their is a Traditional way, for all variable(different datatype). i,e. Consider, Dim str As String = "Iam a string" Dim integ As Integer = 0 Dim da As Date = "#6/22/2007#" Dim ss As String ss = "'" & str & "' " & integ & " '" & da & "'" Answer = 'Iam a string' 0 '6/22/2007' I thing u got the answer. If hve any problem msg me friend...........

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups