| | |
How to link a data row to datetimepicker
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Sep 2007
Posts: 3
Reputation:
Solved Threads: 0
I have a Table with a 'Dates' Field as the primary key and 20 other Fields of Integer Type. This is the Master Table with 9 other Detail Tables all with a 'Dates' key field. I have a form to view all this and it works fine.
My problem is to select the row of the Master Table with a date selected by a DateTimePicker Component instead of having to click through lots of rows until I get to the required date.
I have tried all sorts of ways but cannot get close - I have no sample code because nothing I have tried works for me !!
I feel a right idiot because it must be very simple to do it.
Please help !!!
My problem is to select the row of the Master Table with a date selected by a DateTimePicker Component instead of having to click through lots of rows until I get to the required date.
I have tried all sorts of ways but cannot get close - I have no sample code because nothing I have tried works for me !!
I feel a right idiot because it must be very simple to do it.
Please help !!!
Did you try databinding?
I don't think that'll work very well though. If you pick a date that isn't in the table, you'll probably get an exception. How about using a combo box instead of a date time picker? That makes more sense because you're picking from a subset of dates that exist in the table, but a date time picker lets you pick from all possible dates.
vbnet Syntax (Toggle Plain Text)
DateTimePicker1.DataBindings.Add( "Value", MasterTable, "Dates" )
The truth does not change according to our ability to stomach it.
•
•
Join Date: Sep 2007
Posts: 3
Reputation:
Solved Threads: 0
Hi
Thanks very much. Got it to work after a while. I am new to VB. Last time i used it was way back in version 1.
It is not quite what I was wanting but is good enough. I see the datetimepicker does not have 'DataSource' and 'DisplayMember' properties. Would it very difficult to add these properties? I have done a bit of modifying components in Delphi.
Thanks again - I will be able to sleep tonight. I live in South Africa so it is getting to bedtime.
Alan
Thanks very much. Got it to work after a while. I am new to VB. Last time i used it was way back in version 1.
It is not quite what I was wanting but is good enough. I see the datetimepicker does not have 'DataSource' and 'DisplayMember' properties. Would it very difficult to add these properties? I have done a bit of modifying components in Delphi.
Thanks again - I will be able to sleep tonight. I live in South Africa so it is getting to bedtime.
Alan
•
•
•
•
I see the datetimepicker does not have 'DataSource' and 'DisplayMember' properties.
•
•
•
•
Would it very difficult to add these properties?
The truth does not change according to our ability to stomach it.
•
•
•
•
My problem with the combobox is that i have info going back 5 years and the Datetimepicker is easier to use to find the old data if needed.
The truth does not change according to our ability to stomach it.
![]() |
Similar Threads
- Apache (Linux Servers and Apache)
- copying Msflexgrid row and column data to excel (Visual Basic 4 / 5 / 6)
- PHP-MySQL retrieval or getting data (PHP)
- Link Popularity (Search Engine Optimization)
- a question about heap data structure (C)
- Displaying datagrid on second form (VB.NET)
- displaying products in categories (PHP)
- Using a class to add/delete/show numbers in a Link List (C++)
- Getting next and previous row in a MySQL set! (PHP)
- link text boxes with listbox (VB.NET)
Other Threads in the VB.NET Forum
- Previous Thread: Threading, Delegates and the Invoke method.
- Next Thread: DataSets in Excel to be used in VB
| Thread Tools | Search this Thread |
.net .net2008 30minutes 2005 2008 access account arithmetic array basic bing button buttons center check code combobox component connectionstring crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dropdownlist excel fade file-dialog filter folder ftp generatetags google gridview hardcopy images input insert intel internet mobile monitor ms net networking objects output panel passingparameters peertopeervideostreaming picturebox picturebox1 port position print printing problem problemwithinstallation project save searchbox searchvb.net select serial shutdown soap survey table tcp temperature text textbox timer timespan toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf year





