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. Web Development
  3. ASP.NET
  4. Monthname() function

Monthname() function

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasemysqlsales
7 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.
  • T Offline
    T Offline
    thuyaaung7
    wrote on last edited by
    #1

    Hi All, I am using monthname() function for particular boundfield for a gridview in ASP.NET2.0. When I display it It shows "system.byte[]" in the cell instead of particular Month name. I am using MySQL database and the command is "SELECT MONTHNAME(sales.issuedate) AS 'Month', Count(Month (date(sales.issuedate))) AS 'Sale' From sales Group by Month(date(sales.issuedate))" I look for the solution on the NET but no luck. Please help me out. good day :)

    P 1 Reply Last reply
    0
    • T thuyaaung7

      Hi All, I am using monthname() function for particular boundfield for a gridview in ASP.NET2.0. When I display it It shows "system.byte[]" in the cell instead of particular Month name. I am using MySQL database and the command is "SELECT MONTHNAME(sales.issuedate) AS 'Month', Count(Month (date(sales.issuedate))) AS 'Sale' From sales Group by Month(date(sales.issuedate))" I look for the solution on the NET but no luck. Please help me out. good day :)

      P Offline
      P Offline
      Prateek G
      wrote on last edited by
      #2

      which method u r using to retrieve value from database. like executenonquery etc.. Better if u can paste the code here.

      T 1 Reply Last reply
      0
      • P Prateek G

        which method u r using to retrieve value from database. like executenonquery etc.. Better if u can paste the code here.

        T Offline
        T Offline
        thuyaaung7
        wrote on last edited by
        #3

        Hi, I used sqldatasource. The following is the command. I hope this is the ans for your question.

        P 1 Reply Last reply
        0
        • T thuyaaung7

          Hi, I used sqldatasource. The following is the command. I hope this is the ans for your question.

          P Offline
          P Offline
          Prateek G
          wrote on last edited by
          #4

          where are u storing result of the query.... and In which line u r gettin error..

          T 1 Reply Last reply
          0
          • P Prateek G

            where are u storing result of the query.... and In which line u r gettin error..

            T Offline
            T Offline
            thuyaaung7
            wrote on last edited by
            #5

            Hi G, I am displaying the data in a boundfield of a GridView. There is no error. It works fine. But It just does not showing the right format of the result. The result should be the name of the months. But It is showing "System.Byte[]" instead. The result ---------------------------------¬ Months ¦ Number of Sales ¦ --------------¦------------------¦ System.Byte[] ¦ 11 ¦ --------------¦------------------¦ System.Byte[] ¦ 37 ¦ ---------------------------------- -- modified at 5:49 Wednesday 28th November, 2007

            P 1 Reply Last reply
            0
            • T thuyaaung7

              Hi G, I am displaying the data in a boundfield of a GridView. There is no error. It works fine. But It just does not showing the right format of the result. The result should be the name of the months. But It is showing "System.Byte[]" instead. The result ---------------------------------¬ Months ¦ Number of Sales ¦ --------------¦------------------¦ System.Byte[] ¦ 11 ¦ --------------¦------------------¦ System.Byte[] ¦ 37 ¦ ---------------------------------- -- modified at 5:49 Wednesday 28th November, 2007

              P Offline
              P Offline
              Prateek G
              wrote on last edited by
              #6

              Thats wot I want to know wot value u r assigning to Months column.

              T 1 Reply Last reply
              0
              • P Prateek G

                Thats wot I want to know wot value u r assigning to Months column.

                T Offline
                T Offline
                thuyaaung7
                wrote on last edited by
                #7

                I assign the return data from sql statement which is string (because when I extract MONTHNAME from date it would return a string). So there should not be System.Byte[] in the cell of the gridview.:doh:

                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