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.
Loading
Rodrigo BeretaPosted Apr 9, 2013, 4:08 PM
Try this:
To format the textbox you can use jquery .mask.
Regards.
Vishal GilbilePosted Apr 9, 2013, 5:28 AM
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.