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. Problem in Datagrid with sqldatasource

Problem in Datagrid with sqldatasource

Scheduled Pinned Locked Moved ASP.NET
helpquestion
8 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.
  • C Offline
    C Offline
    ChennaiBabu
    wrote on last edited by
    #1

    Hi all, i'm using a datagrid with a sqldatasource.in that i'm using where clause with 2 parameters student ID and name.but the select statement is not working when there is both ID and name is present.But its working and display the data with the ID only.Can any one give me the solutions for this? Babu

    _ 1 Reply Last reply
    0
    • C ChennaiBabu

      Hi all, i'm using a datagrid with a sqldatasource.in that i'm using where clause with 2 parameters student ID and name.but the select statement is not working when there is both ID and name is present.But its working and display the data with the ID only.Can any one give me the solutions for this? Babu

      _ Offline
      _ Offline
      _AK_
      wrote on last edited by
      #2

      What is the sql statement which you are using? Best Regards, Apurva Kaushal

      C 1 Reply Last reply
      0
      • _ _AK_

        What is the sql statement which you are using? Best Regards, Apurva Kaushal

        C Offline
        C Offline
        ChennaiBabu
        wrote on last edited by
        #3

        select [StudentID],[Name],[Percentage] from tblstudent WHERE (StudentID = @StudentID AND Name=@Name AND Percentage=@Percentage) this was the statement in the sqldatasource tool. Babu

        _ 1 Reply Last reply
        0
        • C ChennaiBabu

          select [StudentID],[Name],[Percentage] from tblstudent WHERE (StudentID = @StudentID AND Name=@Name AND Percentage=@Percentage) this was the statement in the sqldatasource tool. Babu

          _ Offline
          _ Offline
          _AK_
          wrote on last edited by
          #4

          Hi, Do you have any record in the database which is satisfying all the conditions here because your query is correct. Best Regards, Apurva Kaushal

          C 1 Reply Last reply
          0
          • _ _AK_

            Hi, Do you have any record in the database which is satisfying all the conditions here because your query is correct. Best Regards, Apurva Kaushal

            C Offline
            C Offline
            ChennaiBabu
            wrote on last edited by
            #5

            hi, i've applied this query for another table too.that is for customers.even for that it was not working. can you give me the sql statement using OR Condition.will it work. Actually in sqldatasource there is no need to write coding manually.just in configuration mode we can create with the option "Where" button. Babu

            _ 1 Reply Last reply
            0
            • C ChennaiBabu

              hi, i've applied this query for another table too.that is for customers.even for that it was not working. can you give me the sql statement using OR Condition.will it work. Actually in sqldatasource there is no need to write coding manually.just in configuration mode we can create with the option "Where" button. Babu

              _ Offline
              _ Offline
              _AK_
              wrote on last edited by
              #6

              Hi, If you are using and condition then all the conditions has to be satisfied then only you will be able to get the result. So according to your query is you are having a record which is having all the StudentID, Name and Percentage which you have passed that will be fetched. For OR condition just replace and with or. Hope this will help you. Best Regards, Apurva Kaushal

              C 1 Reply Last reply
              0
              • _ _AK_

                Hi, If you are using and condition then all the conditions has to be satisfied then only you will be able to get the result. So according to your query is you are having a record which is having all the StudentID, Name and Percentage which you have passed that will be fetched. For OR condition just replace and with or. Hope this will help you. Best Regards, Apurva Kaushal

                C Offline
                C Offline
                ChennaiBabu
                wrote on last edited by
                #7

                SELECT [CustCode], [Name], [Addr], [OrdType], [Area], [Lob] FROM [Customer] WHERE (([CustCode] = @CustCode) OR ([Country] = @Country)) i was using dis query for another table access.but its not working. Babu

                _ 1 Reply Last reply
                0
                • C ChennaiBabu

                  SELECT [CustCode], [Name], [Addr], [OrdType], [Area], [Lob] FROM [Customer] WHERE (([CustCode] = @CustCode) OR ([Country] = @Country)) i was using dis query for another table access.but its not working. Babu

                  _ Offline
                  _ Offline
                  _AK_
                  wrote on last edited by
                  #8

                  are you getting any error or simply not getting the result. In case of of the second just check whether you are having the required records in the table. Best Regards, Apurva Kaushal

                  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