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. sqldata adapter

sqldata adapter

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasehelpasp-nettutorial
9 Posts 4 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.
  • K Offline
    K Offline
    komalcse
    wrote on last edited by
    #1

    I am using Asp.Net and C# with SQL Am using sqldataadapter and dataset to diaplay the records from the database but i want to display the error message when there is no records in the database how to do that can anyone help plz komal

    S 1 Reply Last reply
    0
    • K komalcse

      I am using Asp.Net and C# with SQL Am using sqldataadapter and dataset to diaplay the records from the database but i want to display the error message when there is no records in the database how to do that can anyone help plz komal

      S Offline
      S Offline
      Sherin Iranimose
      wrote on last edited by
      #2

      Hi, rccount = (int)DS.Tables("YourTable").Rows.Count

      **$**herin Iranimose

      K N 3 Replies Last reply
      0
      • S Sherin Iranimose

        Hi, rccount = (int)DS.Tables("YourTable").Rows.Count

        **$**herin Iranimose

        K Offline
        K Offline
        komalcse
        wrote on last edited by
        #3

        i have binded the records from the database and its working, but i have written a query to sum a column and display in different column, so totally 2 tables should be binded, i have binded using 'foreach' i don't know how to get the error message

        1 Reply Last reply
        0
        • S Sherin Iranimose

          Hi, rccount = (int)DS.Tables("YourTable").Rows.Count

          **$**herin Iranimose

          K Offline
          K Offline
          komalcse
          wrote on last edited by
          #4

          i have binded the records from the database and its working, but i have written a query to sum a column and display in different column, so totally 2 tables should be binded, i have binded using 'foreach' i don't know how to get the error message

          N 1 Reply Last reply
          0
          • K komalcse

            i have binded the records from the database and its working, but i have written a query to sum a column and display in different column, so totally 2 tables should be binded, i have binded using 'foreach' i don't know how to get the error message

            N Offline
            N Offline
            NanaAM
            wrote on last edited by
            #5

            Create one label outside grid. And when your foreach loop enda, just check grid.rows.count. If its 0 then directly display 'No records found' msg in the label

            Nana

            K 1 Reply Last reply
            0
            • S Sherin Iranimose

              Hi, rccount = (int)DS.Tables("YourTable").Rows.Count

              **$**herin Iranimose

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

              $herin wrote:

              rccount = (int)DS.Tables("YourTable").Rows.Count

              Property Count return an integer value, no need of explicit conversion here.

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

              S 1 Reply Last reply
              0
              • N N a v a n e e t h

                $herin wrote:

                rccount = (int)DS.Tables("YourTable").Rows.Count

                Property Count return an integer value, no need of explicit conversion here.

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

                S Offline
                S Offline
                Sherin Iranimose
                wrote on last edited by
                #7

                Thanks...

                **$**herin Iranimose

                1 Reply Last reply
                0
                • N NanaAM

                  Create one label outside grid. And when your foreach loop enda, just check grid.rows.count. If its 0 then directly display 'No records found' msg in the label

                  Nana

                  K Offline
                  K Offline
                  komalcse
                  wrote on last edited by
                  #8

                  i have used databind to the grid how can i use this condition

                  N 1 Reply Last reply
                  0
                  • K komalcse

                    i have used databind to the grid how can i use this condition

                    N Offline
                    N Offline
                    NanaAM
                    wrote on last edited by
                    #9

                    Afer binding you can still check it.

                    Nana

                    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