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. Populate gridview in asp.net ajax

Populate gridview in asp.net ajax

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netdatabasesales
8 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.
  • M Offline
    M Offline
    Mamphekgo Bahula
    wrote on last edited by
    #1

    Hi i have written this code to populate gridview in asp.net ajax but it doesn't give me any error or populate my gridview so i can figure out what is a problem.my database does't have password it have only user id which i provided. here is my code string conString = @"Data Source=DAKESERVER;Initial Catalog=Customer;User ID=sa"; SqlConnection conCustomer = new SqlConnection(conString); SqlCommand cmdCustomer = new SqlCommand(); SqlDataAdapter daCustomer = new SqlDataAdapter(); DataSet dsCustomer = new DataSet(); cmdCustomer.Connection = conCustomer; daCustomer.SelectCommand = cmdCustomer; cmdCustomer.CommandText = "SELECT * FROM CustomerDetails"; daCustomer.Fill(dsCustomer); GridView1.DataSource = dsCustomer; GridView1.DataBind(); conCustomer.Close();

    Mamphekgo

    R N 2 Replies Last reply
    0
    • M Mamphekgo Bahula

      Hi i have written this code to populate gridview in asp.net ajax but it doesn't give me any error or populate my gridview so i can figure out what is a problem.my database does't have password it have only user id which i provided. here is my code string conString = @"Data Source=DAKESERVER;Initial Catalog=Customer;User ID=sa"; SqlConnection conCustomer = new SqlConnection(conString); SqlCommand cmdCustomer = new SqlCommand(); SqlDataAdapter daCustomer = new SqlDataAdapter(); DataSet dsCustomer = new DataSet(); cmdCustomer.Connection = conCustomer; daCustomer.SelectCommand = cmdCustomer; cmdCustomer.CommandText = "SELECT * FROM CustomerDetails"; daCustomer.Fill(dsCustomer); GridView1.DataSource = dsCustomer; GridView1.DataBind(); conCustomer.Close();

      Mamphekgo

      R Offline
      R Offline
      Ron S
      wrote on last edited by
      #2

      use update panel from the ajaxextensions. then create a trigger control for the grid to load.

      Bharath.S Ron

      M 1 Reply Last reply
      0
      • M Mamphekgo Bahula

        Hi i have written this code to populate gridview in asp.net ajax but it doesn't give me any error or populate my gridview so i can figure out what is a problem.my database does't have password it have only user id which i provided. here is my code string conString = @"Data Source=DAKESERVER;Initial Catalog=Customer;User ID=sa"; SqlConnection conCustomer = new SqlConnection(conString); SqlCommand cmdCustomer = new SqlCommand(); SqlDataAdapter daCustomer = new SqlDataAdapter(); DataSet dsCustomer = new DataSet(); cmdCustomer.Connection = conCustomer; daCustomer.SelectCommand = cmdCustomer; cmdCustomer.CommandText = "SELECT * FROM CustomerDetails"; daCustomer.Fill(dsCustomer); GridView1.DataSource = dsCustomer; GridView1.DataBind(); conCustomer.Close();

        Mamphekgo

        N Offline
        N Offline
        N a r e s h P a t e l
        wrote on last edited by
        #3

        If does not have any password then leave the password field blank. Like: string conString = @"Data Source=DAKESERVER;Initial Catalog=Customer;User ID=sa; Password=";

        Naresh Patel

        M 1 Reply Last reply
        0
        • R Ron S

          use update panel from the ajaxextensions. then create a trigger control for the grid to load.

          Bharath.S Ron

          M Offline
          M Offline
          Mamphekgo Bahula
          wrote on last edited by
          #4

          i have update panel. can you please give me a clue of how to do it

          Mamphekgo

          1 Reply Last reply
          0
          • N N a r e s h P a t e l

            If does not have any password then leave the password field blank. Like: string conString = @"Data Source=DAKESERVER;Initial Catalog=Customer;User ID=sa; Password=";

            Naresh Patel

            M Offline
            M Offline
            Mamphekgo Bahula
            wrote on last edited by
            #5

            Hi it now gives me this error format of the initialization string does not conform to specification starting at index 59

            Mamphekgo

            S 1 Reply Last reply
            0
            • M Mamphekgo Bahula

              Hi it now gives me this error format of the initialization string does not conform to specification starting at index 59

              Mamphekgo

              S Offline
              S Offline
              sidbaruah
              wrote on last edited by
              #6

              Have you initialized the triggers properly???

              I was born dumb!! :laugh:Programming made me laugh:laugh:!!! --sid--

              R 1 Reply Last reply
              0
              • S sidbaruah

                Have you initialized the triggers properly???

                I was born dumb!! :laugh:Programming made me laugh:laugh:!!! --sid--

                R Offline
                R Offline
                Ron S
                wrote on last edited by
                #7

                go to the properties int the update panel and create trigger for loading the grid. for example if your loading the grid on click of the button then create trgger for that button click even . it will populate the grid

                Bharath.S Ron

                S 1 Reply Last reply
                0
                • R Ron S

                  go to the properties int the update panel and create trigger for loading the grid. for example if your loading the grid on click of the button then create trgger for that button click even . it will populate the grid

                  Bharath.S Ron

                  S Offline
                  S Offline
                  sidbaruah
                  wrote on last edited by
                  #8

                  Hey Bharath!! Reply to his thread as an answer or else he wont know about the reply uve posted!!

                  I was born dumb!! :laugh:Programming made me laugh:laugh:!!! --sid--

                  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