I am a beginner in vb.net and asp.net. I am having a problem saving the date, which is a string value coming from the DevExpress datepicker control.
The column name is expiryDate
and its type is date
.
Here is my ASPX markup :
<tr>
<td nowrap="nowrap" class="label" align="right" valign="top" style="width: 10%">
Expiry Date
</td>
<td style="width: 40%" valign="top">
<dxe:ASPxDateEdit ID="expiryDate"
runat="server"
EditFormat="Date"
Date="13/06/2014"
Width="200">
</dxe:ASPxDateEdit>
</td>
</tr>
And in C# code behind :
sqlSave = "INSERT INTO [Product] (Title, expiryDate) VALUES ("
sqlSave += " '" & txtProductName.Text.Trim().Replace("'", "''") & "', "
sqlSave += "" & expiryDate.Text & " )"
I am using expiryDate.Text
to save in the database but the date saved is: 1900-01-01 and sometime i get message Operand type clash: int is incompatible with date
.
I don't know how to fix this issue, please help?