|
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
|
|
|
|
|
Yes, I created an SQL query for it:
SELECT [PermID], [STNAME], [EntryDate], [EntryTime], [Direction], [EntryPrice], [Tradesize], [ExitDate], [ExitTime], [ExitPrice], [profit] FROM [TRADES]
which is exactly the same as (copied from )the code from the fill which works:
SELECT [PermID], [STNAME], [EntryDate], [EntryTime], [Direction], [EntryPrice], [Tradesize], [ExitDate], [ExitTime], [ExitPrice], [profit] FROM [TRADES]
|
|
|
|
|
sorry for removing my posts, but I realized you were using vs2005 and that the methods mentioned might be some sort of new functionality in vs2005. All i know is that I have not heard of the second method that you call and that this method does not have a dataset passed into it to be filled or modified, and that the first method called does take in a dataset that will be filled.
eatwork
|
|
|
|
|
Created a query for what?
Is FillByTodayOnly a method you have created?
I am not familiar with it...
Steve
-- modified at 17:29 Thursday 17th August, 2006
|
|
|
|
|
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!
|
|
|
|
|
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!
|
|
|
|
|
maybe you could post your vb code so ppl can analyze that and give a better answer?
eatwork
|
|
|
|
|
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
|
|
|
|
|
Hi, I have a question regarding binding and am looking for the pros and cons of each. The question is whether to bind a windows forms system to a database on the server or to have it store the data locally on each of the clients computers and update/insert/delete/ and refresh only when the user has made a change or switched tab pages etc.
My current database is not connected to the database and retrieves and stores the data in one dataset and that dataset gets updated as needed. Not sure if it is more efficient to connect directly to the database or if it is better coding standards etc to be linked to the database. Thank you
eatwork
|
|
|
|
|
I would imagine the best solution would probably be just to use the database, that is what they are for.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hello christian, thank you for your reply. Point well taken, but does it require more maintenance in the future is it faster, etc? thank you
eatwork
|
|
|
|
|
In fact, it's faster and easier to maintain.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks, are there any other pros / cons that you can think of for binding a database? And do you know of any examples/solutions out there that I could look at? My project has 120 tables and the system requires a user login, the user to select their database connection location on the server and I am not sure I want to continue the project in the unbound format. Thanks
eatwork
|
|
|
|
|
To be honest, I'd assume being bound to the database would be the default, and most examples on the web would assume this approach
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I want fill a listbox with sqlTable Records from Other Page but i don`t know ...:
Best Regards
Hussein Madani Ghomi
+98-912-5577-832
|
|
|
|
|
Hi,
Write a function for filling the list box on the page where the list box is there. Call this function from the other page where you have the data table passing it the data table.
Hope i am clear enough !
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
Hi Dear Anant
I know i have to create a function , but my question had a little wrong.
But my currect question is :
-How to filling a listbox from other page at a web application pages(ASP.NET 2.0)?
however thank you so much...
Best Regards
Hussein Madani Ghomi
+98-912-5577-832
|
|
|
|
|
Hi,
I would like to get a help in this;
Iam using a masked textbox for a time entry.
it is masked as Time(European/Military)(00:00).and in the windowsform it is shown as
--:--
Now if the user enter the inputs, how will i validate that the entry to be in the format of 00:00.
Sometimes users enter the time as --:-1
how will i validate this type false entry in a maskedtextbox.
please help .
chepps
|
|
|
|
|
I have a masked textbox for dates (mm/dd/yyyy). One validation that I did do was to see if (after trimming) the text was to see if it was below the 10 characters it should be. Maybe you can do that here. If the length is 5, then you can parse the data out (hour and minute) to make sure each value is within the valid hour (00-23) and minute (00-59) [unless there is a function to validate time].
I'm curious to see other suggestions, though.
|
|
|
|
|
iam not able to take that 2 parts seperately at the same time from the masked textbox.AT a time i can take only hours or minutes.not both.
Could u please tell me the condition to check whether the hours part falls in 00 to 23.because to put in a integer loop i will not get the values as 00,01...till 09.
please help.
rgds,
CHepps
|
|
|
|
|
In the validation method of the masked textbox (mt for now), I would do something like...
hr=cint(mid(mt.text,1,2))
min=cint(mid(mt.text,3,2))
if hr<0 or hr>23
' Error!!!
end if
if min<0 or min>59
' Error!!!
end if
Hope this helps.
|
|
|
|