Datetimepicker with XML dataset problem

JackFox

New member
Joined
Dec 19, 2006
Messages
1
Programming Experience
Beginner
I am using the datetimepicker control with a dataset, and it works (ie. Updates the value in the dataset when I changed it) except for the last record I change unless I change record. Any idea why..? (The cboBox works fine for the same app. – code not shown here)

Here’s the code. ..
VB.NET:
[/SIZE][/FONT]
[COLOR=blue][FONT=Courier New]Dim[/FONT][/COLOR][FONT=Courier New] DS [COLOR=blue]As[/COLOR] [COLOR=blue]New[/COLOR] DataSet[/FONT]
[FONT=Courier New]DS.ReadXml("\program files\ADOCodeGuru\FixedAssetsDate.xml")[/FONT]
 
[FONT=Courier New]m_picker = [COLOR=blue]New[/COLOR] DateTimePicker[/FONT]
[FONT=Courier New]txtNo.DataBindings.Add("Text", DS.Tables(0), "No")[/FONT]
 
[FONT=Courier New]‘ etc…..bind other controls[/FONT]
 
[COLOR=blue][FONT=Courier New]‘ Location & size of datetimepicker[/FONT][/COLOR]
[COLOR=blue][FONT=Courier New]With[/FONT][/COLOR][FONT=Courier New] m_picker[/FONT]
[FONT=Courier New].Location = [COLOR=blue]Me[/COLOR].lblPlaceHolder.Location[/FONT]
[FONT=Courier New].Size = [COLOR=blue]Me[/COLOR].lblPlaceHolder.Size[/FONT]
[COLOR=blue][FONT=Courier New]End[/FONT][/COLOR][FONT=Courier New] [COLOR=blue]With[/COLOR][/FONT]
 
[COLOR=blue][FONT=Courier New]With[/FONT][/COLOR][FONT=Courier New] lblPlaceHolder.Parent.Controls[/FONT]
[FONT=Courier New].Add(m_picker)[/FONT]
[FONT=Courier New].Remove(lblPlaceHolder)[/FONT]
[COLOR=blue][FONT=Courier New]End[/FONT][/COLOR][FONT=Courier New] [COLOR=blue]With[/COLOR][/FONT]
 
[FONT=Courier New]m_picker.Format = DateTimePickerFormat.Short[/FONT]
[FONT=Courier New]m_picker.DataBindings.Add("Text", DS.Tables(0), "LastAuditDate")[/FONT]
[FONT=Times New Roman][SIZE=3]
here is the format within the xml file:-
HTML:
<LastAuditDate>01/01/2000</LastAuditDate>
 
Last edited by a moderator:
Back
Top