hi friends i am saving a text box value in sql database but here is some error in my code. my sql database colum datatype is datetime.
i want to use this textbox for date entry in DD/MM/YYYY format....please help me out. waiting for good response.
Save a date value in sql from textbox in asp.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Vishal GilbileRank #268 · 9.4K reputationPosted Apr 9, 2013, 1:28 AM EDT
you could simply store the value in DB in DD/MM/YYYY format by using the following snippet.
string str=textBox1.Text.ToString("dd/MM/yyyy");
now pass this str variable value to your database query.
cmd.Parameters.AddWithValue("@date",str);
Hope that solves your problem.
With Regards,
Vishal Gilbile.
Rodrigo Bereta40 reputationPosted Apr 9, 2013, 12:08 PM EDT
Try this:
To format the textbox you can use jquery .mask.
Regards.