Empty fields in databinding

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi

I have date/time fields in database access table and i would like to be
able to have the choice to be empty when i click the submit button in
my vb.net form.

In the click event of the submit button i have the following code:
Me.comInsertIC.Parameters("expirydatecoke05lpet").Value =
Me.txtexpirydatecoke05lpet.Text

comInsertIC is the insert command generated by the adapter.

When I click submit button and the field is an empty string I get the
following exception: String was not recognised as a valid datetime.

What can I do in the case of adding a new record and editing an
existing one?
(I use the comInsertIC for adding and for editing the following code:
Me.BindingContext(Me.datasetAddEditIC.ic).EndCurrentEdit()
Me.adapter.AddEditIC.Update(Me.datasetAddEditIC.ic)

Thank you
Savvas

.



Relevant Pages

  • Re: Convertin dbnull to string
    ... I think what you should do is to assign dbnull value to ... >a valid DateTime. ... >> DbNull is a special value and not an empty string. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: a simpler way...?
    ... You mentioned that you were editing with a MRO, ... Do you do the data entry right in the original table? ... I have created empty temporary tables on the fly, ... and then add all the detail records. ...
    (comp.databases.paradox)
  • Re: Used space on hard drive
    ... It was showing empty but it actually contained 54gigs and didn't empty when it was told to! ... You say you're editing these files. ... "Converted" folder. ... > external hard drives, then delete them from the machine. ...
    (microsoft.public.windowsxp.hardware)
  • Re: Enter "Empty" if cell is blank within a variable range
    ... Dim Test As String ... My suggeste code will populate all empty cells columns A:B, ... I have checked the value of the cell with the following. ... The debugger displays an empty string value. ...
    (microsoft.public.excel.programming)
  • Re: Semi OT: To Null or not to Null
    ... And suppose that an empty string is a ... decision to put a value, even an empty or default one, in that field. ... > Load() ... > nulls, or checking on save to transform defaults to nulls. ...
    (microsoft.public.dotnet.languages.csharp)