What the theck am I missing: Filling tables
-
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
-
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
What is FillByTodayOnly() ?? Steve
-
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
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)
-
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)
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!
-
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!
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
-
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
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!
-
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!
-
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!
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.
-
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.
Keith...that's perfect! Somehow, a slight variation on what I had done. Thanks to everyone for their patience!!!! chuck