entering Null value for Date field
I have a form to enter two date values into db. One of the date fields is optional.
How can I write an insert statement that allows an empty string or null value for courseDate2?
dim courseNumber as integer=dgCourseList.datakeys(e.item.itemindex)
dim courseDate as date=ctype(e.item.findcontrol("courseDate"),textbo x).text
dim courseDate2 as date=ctype(e.item.findcontrol("courseDate2"),textb ox).text
ourCommand= new odbccommand("UPDATE coursesInd SET courseDate='" & courseDate & "', courseDate2='" & courseDate2 & "' WHERE courseNumber="&courseNumber, ourConnection)
thanks in advance
|