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. General Programming
  3. Visual Basic
  4. Does any one know what i have done wrong

Does any one know what i have done wrong

Scheduled Pinned Locked Moved Visual Basic
securityhelp
6 Posts 3 Posters 2 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 Offline
    S Offline
    solarthur01
    wrote on last edited by
    #1

    i am trying to use the gridview to display information but its not building. Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim dbconnection As SqlConnection Dim command As SqlCommand dbconnection = New SqlConnection("Data Source=localhost\SQLEXPRESS;Initial Catalog=test;Integrated Security=True") command = New SqlCommand("Select * from tblcustomers", dbconnection) dbconnection.Open() 'MsgBox("connection open") GridView1.DataSource = command.EndExecuteReader() <------error on this line GridView1.DataBind() dbconnection.Close()

    P 1 Reply Last reply
    0
    • S solarthur01

      i am trying to use the gridview to display information but its not building. Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim dbconnection As SqlConnection Dim command As SqlCommand dbconnection = New SqlConnection("Data Source=localhost\SQLEXPRESS;Initial Catalog=test;Integrated Security=True") command = New SqlCommand("Select * from tblcustomers", dbconnection) dbconnection.Open() 'MsgBox("connection open") GridView1.DataSource = command.EndExecuteReader() <------error on this line GridView1.DataBind() dbconnection.Close()

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      solarthur01 wrote:

      command.EndExecuteReader()

      Shouldn't it be: command.ExecuteReader()

      "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon

      S 1 Reply Last reply
      0
      • P Paul Conrad

        solarthur01 wrote:

        command.EndExecuteReader()

        Shouldn't it be: command.ExecuteReader()

        "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon

        S Offline
        S Offline
        solarthur01
        wrote on last edited by
        #3

        many thanks. I used a different method: Dim myconnection As SqlConnection = New SqlConnection("Data Source=localhost\SQLEXPRESS;Initial Catalog=test;Integrated Security=True") myconnection.Open() Dim ad As SqlDataAdapter = New SqlDataAdapter("Select * from tblcustomers", myconnection) Dim ds As DataSet = New DataSet ad.Fill(ds, "tblcustomers") GridView1.DataSource = ds GridView1.DataBind() myconnection.Close() Label1.Text = ("Database connection open") Do you know how i can use the sleep function to let it sleep before displaying the next record...so as supopsed to displaying all the records at once, it will display it in time interval of say 3000 mseconds??

        P 1 Reply Last reply
        0
        • S solarthur01

          many thanks. I used a different method: Dim myconnection As SqlConnection = New SqlConnection("Data Source=localhost\SQLEXPRESS;Initial Catalog=test;Integrated Security=True") myconnection.Open() Dim ad As SqlDataAdapter = New SqlDataAdapter("Select * from tblcustomers", myconnection) Dim ds As DataSet = New DataSet ad.Fill(ds, "tblcustomers") GridView1.DataSource = ds GridView1.DataBind() myconnection.Close() Label1.Text = ("Database connection open") Do you know how i can use the sleep function to let it sleep before displaying the next record...so as supopsed to displaying all the records at once, it will display it in time interval of say 3000 mseconds??

          P Offline
          P Offline
          Paul Conrad
          wrote on last edited by
          #4

          Use the Timer class.

          "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon

          S 1 Reply Last reply
          0
          • P Paul Conrad

            Use the Timer class.

            "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon

            S Offline
            S Offline
            solarthur01
            wrote on last edited by
            #5

            do you know how i can implement it or where i can get some information about it from?

            C 1 Reply Last reply
            0
            • S solarthur01

              do you know how i can implement it or where i can get some information about it from?

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

              Google.

              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
              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