Wrong ADO Date Textbox Format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

An incorrect date and time format appears in the Textbox when I _Leave(..)
the date TB and focus on another TB for the same Datagrid index (1/8/05
12:00:00 AM vice 1/8/05).

I have an MS-Access DS bound to a DG and TB’s. The TB’s reveal the contents
of each column of the DG at the specified DG index (one of which is date).

_LoadWinForm(..) {
formatDateTextbox(); //works ok
}

_LeaveDateTextbox(..) {
DSsave();
formatDateTextbox(); //doesn’t work
}

_ValidatingDateTextbox (..) and
_OnListChanged(..)
formatDateTextbox(); //doesn’t work
}

//fires when DG index changes
_CurrentCellChanged(..) {
formatDateTextbox(); // works ok
}

formatDateTextbox() {
DateTime dt = Convert.ToDateTime(DS.Tables[0].Rows[row][col]);
dateTB.Text = dt.ToString("MM/dd/yyyy");
}
 
If I try adding a textbox_BindingContextChange(..) event I get an System Out
of Memory exception, "Error Creating Window Handle"
 
Back
Top