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. eval and databinder.eval

eval and databinder.eval

Scheduled Pinned Locked Moved ASP.NET
wpfwcftutorial
13 Posts 5 Posters 1 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.
  • S Sonia Gupta

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { quantityTotal += ((int)(Eval("Quantity"))); priceTotal += ((decimal)(Eval("SubTotal"))); } } there is a compilation mistake. i think i should use the <%# (inline binding) along with this Eval("Quantity") at opening and closing how to do this

    Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

    I Offline
    I Offline
    InsDev
    wrote on last edited by
    #2

    use like this <%# Eval("Quantity") %> Devjit Das.

    S 1 Reply Last reply
    0
    • I InsDev

      use like this <%# Eval("Quantity") %> Devjit Das.

      S Offline
      S Offline
      Sonia Gupta
      wrote on last edited by
      #3

      i am currently in the rowe bound function of grid view in code behind. the synatx error is invalid character #

      Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

      I 1 Reply Last reply
      0
      • S Sonia Gupta

        i am currently in the rowe bound function of grid view in code behind. the synatx error is invalid character #

        Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

        I Offline
        I Offline
        InsDev
        wrote on last edited by
        #4

        what u want to do . just to convert in integer. (int)(quantity) will convert in integer. Devjit Das.

        S 1 Reply Last reply
        0
        • S Sonia Gupta

          protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { quantityTotal += ((int)(Eval("Quantity"))); priceTotal += ((decimal)(Eval("SubTotal"))); } } there is a compilation mistake. i think i should use the <%# (inline binding) along with this Eval("Quantity") at opening and closing how to do this

          Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #5

          I guess you are doing this in code behind. It's not possible to do this on code behind. You can use the GridViewRowEventArgs object e, and access the cell value instead.

          All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

          1 Reply Last reply
          0
          • I InsDev

            what u want to do . just to convert in integer. (int)(quantity) will convert in integer. Devjit Das.

            S Offline
            S Offline
            Sonia Gupta
            wrote on last edited by
            #6

            i was trying to know the basic differences between eval("abc") databinder.eval(container.dataitem,"abc") as in the item template and edit item template the formmer one is working . i am not being able to understand in which condition , i should use which one, the former one , just making the syntax easy , i think.

            Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

            I C 2 Replies Last reply
            0
            • S Sonia Gupta

              i was trying to know the basic differences between eval("abc") databinder.eval(container.dataitem,"abc") as in the item template and edit item template the formmer one is working . i am not being able to understand in which condition , i should use which one, the former one , just making the syntax easy , i think.

              Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

              I Offline
              I Offline
              InsDev
              wrote on last edited by
              #7

              go through this link http://forums.asp.net/p/984156/1264782.aspx or u have all ready visit then u must get the difference. Devjit Das.

              P 1 Reply Last reply
              0
              • S Sonia Gupta

                i was trying to know the basic differences between eval("abc") databinder.eval(container.dataitem,"abc") as in the item template and edit item template the formmer one is working . i am not being able to understand in which condition , i should use which one, the former one , just making the syntax easy , i think.

                Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #8

                Eval is just syntactic sugar, it's just a shortcut that does the same thing. I got the impression you were trying to do a <%# block in your code behind, you can't - that block is to tell the aspx that it's code, you're already in the code behind and don't need it.

                Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                1 Reply Last reply
                0
                • I InsDev

                  go through this link http://forums.asp.net/p/984156/1264782.aspx or u have all ready visit then u must get the difference. Devjit Das.

                  P Offline
                  P Offline
                  Piyush Vardhan Singh
                  wrote on last edited by
                  #9

                  helloooo i am using this query SELECT Format([StartDateTime], "dd mm yyyy") as StartDate, Format([StartDateTime], "dddd") as Day FROM Messages; output of this query:- StartDate Day StartDate Day 13 11 2007 Tuesday 13 11 2007 Tuesday 14 11 2007 Wednesday 14 11 2007 Wednesday 14 11 2007 Wednesday 14 11 2007 Wednesday 14 11 2007 Wednesday now i want to count starttime and out put like this Format(all things in MSaCCess) StartDate – Day - ChatCount 14 Nov 2007- Wednesday – 5 13 Nov 2007- Tuesday – 2

                  Piyush Vardhan Singh

                  I 2 Replies Last reply
                  0
                  • P Piyush Vardhan Singh

                    helloooo i am using this query SELECT Format([StartDateTime], "dd mm yyyy") as StartDate, Format([StartDateTime], "dddd") as Day FROM Messages; output of this query:- StartDate Day StartDate Day 13 11 2007 Tuesday 13 11 2007 Tuesday 14 11 2007 Wednesday 14 11 2007 Wednesday 14 11 2007 Wednesday 14 11 2007 Wednesday 14 11 2007 Wednesday now i want to count starttime and out put like this Format(all things in MSaCCess) StartDate – Day - ChatCount 14 Nov 2007- Wednesday – 5 13 Nov 2007- Tuesday – 2

                    Piyush Vardhan Singh

                    I Offline
                    I Offline
                    InsDev
                    wrote on last edited by
                    #10

                    u have all the query. just check in Archiviewer u will get the same query. Devjit Das.

                    P 1 Reply Last reply
                    0
                    • I InsDev

                      u have all the query. just check in Archiviewer u will get the same query. Devjit Das.

                      P Offline
                      P Offline
                      Piyush Vardhan Singh
                      wrote on last edited by
                      #11

                      but that in sql server and its in ms access syntax is very diff between them

                      Piyush Vardhan Singh

                      I 1 Reply Last reply
                      0
                      • P Piyush Vardhan Singh

                        but that in sql server and its in ms access syntax is very diff between them

                        Piyush Vardhan Singh

                        I Offline
                        I Offline
                        InsDev
                        wrote on last edited by
                        #12

                        just try to use group by or some related to access to get calculate. Devjit Das.

                        1 Reply Last reply
                        0
                        • P Piyush Vardhan Singh

                          helloooo i am using this query SELECT Format([StartDateTime], "dd mm yyyy") as StartDate, Format([StartDateTime], "dddd") as Day FROM Messages; output of this query:- StartDate Day StartDate Day 13 11 2007 Tuesday 13 11 2007 Tuesday 14 11 2007 Wednesday 14 11 2007 Wednesday 14 11 2007 Wednesday 14 11 2007 Wednesday 14 11 2007 Wednesday now i want to count starttime and out put like this Format(all things in MSaCCess) StartDate – Day - ChatCount 14 Nov 2007- Wednesday – 5 13 Nov 2007- Tuesday – 2

                          Piyush Vardhan Singh

                          I Offline
                          I Offline
                          InsDev
                          wrote on last edited by
                          #13

                          try to use this one can solve ur problem. SELECT Format([StartDateTime], "dd mm yyyy") as StartDate, Format([StartDateTime], "dddd") as Day, Count(*) as ChatCount FROM Messages where 1=1 group by Format([StartDateTime], "dd mm yyyy") Devjit Das.

                          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