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. Database & SysAdmin
  3. Database
  4. Simple Dataset Question...

Simple Dataset Question...

Scheduled Pinned Locked Moved Database
databasecsharpquestionhtmlasp-net
5 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.
  • V Offline
    V Offline
    Verdant123
    wrote on last edited by
    #1

    in C# /w asp.net using SQL... (which forum, lol) i have a dataset that i bind to a html datagrid, is there anyway i can manipulate the data in between the grab from the database, and the posting into the table? i just want to do some simple replaces... to replace some strings with images, etc... things i can't do with simple formatting... this is NOT for posting back to the db...

    G 1 Reply Last reply
    0
    • V Verdant123

      in C# /w asp.net using SQL... (which forum, lol) i have a dataset that i bind to a html datagrid, is there anyway i can manipulate the data in between the grab from the database, and the posting into the table? i just want to do some simple replaces... to replace some strings with images, etc... things i can't do with simple formatting... this is NOT for posting back to the db...

      G Offline
      G Offline
      Gerald Leslie Jones
      wrote on last edited by
      #2

      I feel your question is not clear enough to tell us your requirement. Can you explain it bit more detail? If I understand your requirement correctly, I feel you can use template columns in which you can have the images.

      V 1 Reply Last reply
      0
      • G Gerald Leslie Jones

        I feel your question is not clear enough to tell us your requirement. Can you explain it bit more detail? If I understand your requirement correctly, I feel you can use template columns in which you can have the images.

        V Offline
        V Offline
        Verdant123
        wrote on last edited by
        #3

        the data in the database in the columns i want to "interject" is signed integers.... i want negetive integers to have a upwards arrow (html img tag) replace the negative sign, and positive integers to have a downwards facing arrow in front of the number

        B 1 Reply Last reply
        0
        • V Verdant123

          the data in the database in the columns i want to "interject" is signed integers.... i want negetive integers to have a upwards arrow (html img tag) replace the negative sign, and positive integers to have a downwards facing arrow in front of the number

          B Offline
          B Offline
          Bill Dean
          wrote on last edited by
          #4

          Hi, Sure can! Your easiest solution is probably to add a column to your DataTable and set an Expression on that column. Here's code snippet:DataColumn DC=new DataColumn("strDisplay"); DS.Tables[0].Columns.Add (DC); DS.Tables[0].Columns["strDisplay"].Expression = "IIF(iIndex<0,'your downarrow html' + -1*iIndex,'your up arrow html'+iIndex)";
          Check out the VS.NET help for DataColumn.Expression I am assuming 1) that you only have one DataTable in your DataSet 2) that the column of intergers on which you wish to operate is named "iIndex". Then you just display the content of the new column, "strDisplay", in your DataGrid. Hope this helps, Bill

          V 1 Reply Last reply
          0
          • B Bill Dean

            Hi, Sure can! Your easiest solution is probably to add a column to your DataTable and set an Expression on that column. Here's code snippet:DataColumn DC=new DataColumn("strDisplay"); DS.Tables[0].Columns.Add (DC); DS.Tables[0].Columns["strDisplay"].Expression = "IIF(iIndex<0,'your downarrow html' + -1*iIndex,'your up arrow html'+iIndex)";
            Check out the VS.NET help for DataColumn.Expression I am assuming 1) that you only have one DataTable in your DataSet 2) that the column of intergers on which you wish to operate is named "iIndex". Then you just display the content of the new column, "strDisplay", in your DataGrid. Hope this helps, Bill

            V Offline
            V Offline
            Verdant123
            wrote on last edited by
            #5

            thanks! works great!

            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