Use jQuery Date Picker control, it would be easy for you to handle dates in textbox in such formats and to save then in Database.
Add these script files in your HTML page.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.js" type="text/javascript" />
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js" type="text/javascript" />
<script type="text/javascript">
$(function () {
$("#<%=txtDate.ClientID %>").datepicker();
});
</script>
Use such textbox for date selection
<asp:textbox id="txtDate" runat="server" cssclass="fv10" width="150px" xmlns:asp="#unknown"></asp:textbox>
At the end, assign some default date value to textbox at PageLoad event.
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
txtDate.Text = DateTime.Now().ToShortDateString();
}
}
Now at the Page Submit event, you will simply get your date in desired format as
txtDate.Text
command.Parameters.Add("@Date", SqlDbType.VarChar).Value = txtDate.Text;
Hope this helps you.