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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. SQLDATASOURCE

SQLDATASOURCE

Scheduled Pinned Locked Moved ASP.NET
databasehelpsql-serversysadmintutorial
3 Posts 2 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.
  • U Offline
    U Offline
    User 4501991
    wrote on last edited by
    #1

    Does anyone know how to convert a string to a double within the SELECT statement of a SqlDataSource? The data source is a SQL Server database and the values in the fields are all strings. The major problem is that in the Datalist, all of the leading zeros are displayed. Plus I do need to compute one item from three fields. Thanks for you help Gene :omg:

    N 1 Reply Last reply
    0
    • U User 4501991

      Does anyone know how to convert a string to a double within the SELECT statement of a SqlDataSource? The data source is a SQL Server database and the values in the fields are all strings. The major problem is that in the Datalist, all of the leading zeros are displayed. Plus I do need to compute one item from three fields. Thanks for you help Gene :omg:

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Use Cast or Convert http://msdn2.microsoft.com/en-us/library/ms187928.aspx[^]


      only two letters away from being an asset

      U 1 Reply Last reply
      0
      • N Not Active

        Use Cast or Convert http://msdn2.microsoft.com/en-us/library/ms187928.aspx[^]


        only two letters away from being an asset

        U Offline
        U Offline
        User 4501991
        wrote on last edited by
        #3

        Thanks for the response, but I get the error message "InCorrect Syntax" It changes CAST(D1.UNIT_RATE AS DECIMAL(10, 2)) AS Rate, to: [CAST](D1.UNIT_RATE AS [DECIMAL](10, 2)) AS Rate, I am working in Visual Web Developer and it seems that not all of the functionality of SQL Server is available. Gene

        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