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. What the theck am I missing: Filling tables

What the theck am I missing: Filling tables

Scheduled Pinned Locked Moved Visual Basic
database
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.
  • C Offline
    C Offline
    cstrader232
    wrote on last edited by
    #1

    This line fills my table fine: Me.TradesTableAdapter2.Fill(Me.DataSet1.TRADES) This line does not, even though its query is the same as that above, from the same table (Dataset1.TRADES) and the query loads properly in its preview. Me.TradesTableAdapter2.FillByTodayOnly() tia

    S K 2 Replies Last reply
    0
    • C cstrader232

      This line fills my table fine: Me.TradesTableAdapter2.Fill(Me.DataSet1.TRADES) This line does not, even though its query is the same as that above, from the same table (Dataset1.TRADES) and the query loads properly in its preview. Me.TradesTableAdapter2.FillByTodayOnly() tia

      S Offline
      S Offline
      Stephen McGuire
      wrote on last edited by
      #2

      What is FillByTodayOnly() ?? Steve

      1 Reply Last reply
      0
      • C cstrader232

        This line fills my table fine: Me.TradesTableAdapter2.Fill(Me.DataSet1.TRADES) This line does not, even though its query is the same as that above, from the same table (Dataset1.TRADES) and the query loads properly in its preview. Me.TradesTableAdapter2.FillByTodayOnly() tia

        K Offline
        K Offline
        Keith Malwitz
        wrote on last edited by
        #3

        You are not specifying a datatable to be filled in the line: Me.TradesTableAdapter2.FillByTodayOnly() If the query you created is identical to the .Fill one, changing that line to the following should behave identically to it: Me.TradesTableAdapter2.FillByTodayOnly(Me.DataSet1.TRADES)

        C 1 Reply Last reply
        0
        • K Keith Malwitz

          You are not specifying a datatable to be filled in the line: Me.TradesTableAdapter2.FillByTodayOnly() If the query you created is identical to the .Fill one, changing that line to the following should behave identically to it: Me.TradesTableAdapter2.FillByTodayOnly(Me.DataSet1.TRADES)

          C Offline
          C Offline
          cstrader232
          wrote on last edited by
          #4

          Thanks for your help, but it's not helping :) Yes, I'm in vb.net 2005 In my TradesTableAdapter in the Dataset Designer I have created a fillby query. My TradesTableAdapter shows: fill (getdata), and also fillby, FillbyTodayOnly() These seem to be two queries. When I test these out using the "preview" feature in the designer, they both bring in the same data. However, I cannot get FillByTodayOnly() to bring in data programatically. Me.TradesTableAdapter2.FillByTodayOnly() runs but does not read data. However, FillByTodayOnly does not take an argument, so Me.TradesTableAdapter2.FillByTodayOnly(Me.DataSet1.TRADES) is invalid. thanks again!

          K 1 Reply Last reply
          0
          • C cstrader232

            Thanks for your help, but it's not helping :) Yes, I'm in vb.net 2005 In my TradesTableAdapter in the Dataset Designer I have created a fillby query. My TradesTableAdapter shows: fill (getdata), and also fillby, FillbyTodayOnly() These seem to be two queries. When I test these out using the "preview" feature in the designer, they both bring in the same data. However, I cannot get FillByTodayOnly() to bring in data programatically. Me.TradesTableAdapter2.FillByTodayOnly() runs but does not read data. However, FillByTodayOnly does not take an argument, so Me.TradesTableAdapter2.FillByTodayOnly(Me.DataSet1.TRADES) is invalid. thanks again!

            K Offline
            K Offline
            Keith Malwitz
            wrote on last edited by
            #5

            You've lost me. Fill methods MUST take an argument (otherwise they have no idea where to put the data they retrieve). If you created the FillByTodayOnly method using the "Add Query..." option from the dataset designer, you will absolutely need to specify a dataset or datatable to put the data into as a parameter of the method. If your query contains any parameters, these would appear after the dataset/datatable parameter (i.e. tableadapter.FillByTodayOnly(mydataset.thistable, param1, param2). When you type the tableadapter.FillByTodayOnly in code, intellisense should show you the signature of the method, and the first parameter should be a datatable. -- modified at 18:32 Thursday 17th August, 2006

            C 1 Reply Last reply
            0
            • K Keith Malwitz

              You've lost me. Fill methods MUST take an argument (otherwise they have no idea where to put the data they retrieve). If you created the FillByTodayOnly method using the "Add Query..." option from the dataset designer, you will absolutely need to specify a dataset or datatable to put the data into as a parameter of the method. If your query contains any parameters, these would appear after the dataset/datatable parameter (i.e. tableadapter.FillByTodayOnly(mydataset.thistable, param1, param2). When you type the tableadapter.FillByTodayOnly in code, intellisense should show you the signature of the method, and the first parameter should be a datatable. -- modified at 18:32 Thursday 17th August, 2006

              C Offline
              C Offline
              cstrader232
              wrote on last edited by
              #6

              Beats me.... what kind of argument might it need? It won't take one. It seems to know the datasource: Error 1 Too many arguments to 'Public Overridable Overloads Function FillByTodayOnly() As DataSet1.TRADESDataTable'. thanks!

              E K 2 Replies Last reply
              0
              • C cstrader232

                Beats me.... what kind of argument might it need? It won't take one. It seems to know the datasource: Error 1 Too many arguments to 'Public Overridable Overloads Function FillByTodayOnly() As DataSet1.TRADESDataTable'. thanks!

                E Offline
                E Offline
                eatwork
                wrote on last edited by
                #7

                maybe you could post your vb code so ppl can analyze that and give a better answer?

                eatwork

                1 Reply Last reply
                0
                • C cstrader232

                  Beats me.... what kind of argument might it need? It won't take one. It seems to know the datasource: Error 1 Too many arguments to 'Public Overridable Overloads Function FillByTodayOnly() As DataSet1.TRADESDataTable'. thanks!

                  K Offline
                  K Offline
                  Keith Malwitz
                  wrote on last edited by
                  #8

                  Ok, it sounds to me like that is a GetData method, not a fill method. A GetData method actually returns a dataset populated with data, while a fill method populates the specified datatable with data. If you method signature is returning a datatable, as it appears to be in the error you state, it must be a GetData method. Try this.... Go to the dataset designer and right-click on the table adapter you want to use. Select "Add Query". Select "Use SQL statements" then "Query which returns rows". Now type your SQL statement or use the query builder to generate it. The next screen is where you name the methods that FILL a datatable and RETURN(reads GetData) a datatable. Give the FILL method a meaningful name and then try it out.

                  C 1 Reply Last reply
                  0
                  • K Keith Malwitz

                    Ok, it sounds to me like that is a GetData method, not a fill method. A GetData method actually returns a dataset populated with data, while a fill method populates the specified datatable with data. If you method signature is returning a datatable, as it appears to be in the error you state, it must be a GetData method. Try this.... Go to the dataset designer and right-click on the table adapter you want to use. Select "Add Query". Select "Use SQL statements" then "Query which returns rows". Now type your SQL statement or use the query builder to generate it. The next screen is where you name the methods that FILL a datatable and RETURN(reads GetData) a datatable. Give the FILL method a meaningful name and then try it out.

                    C Offline
                    C Offline
                    cstrader232
                    wrote on last edited by
                    #9

                    Keith...that's perfect! Somehow, a slight variation on what I had done. Thanks to everyone for their patience!!!! chuck

                    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