TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
saurabh maheshwari
NA
7
33k
How i convert date in yyyy/mm/dd
Aug 3 2015 8:12 AM
How i can Change my date into yyyy-mm-dd format and this From and to are parameters of SQL Stored Procedure .so please tell me what i do
txt_from.Text='01/08/2015';
txt_to.Text='03/08/2015';
DateTime from = new DateTime(Convert.ToInt32(txt_from.Text.Split('/')[2]), Convert.ToInt32(txt_from.Text.Split('/')[1]), Convert.ToInt32(txt_from.Text.Split('/')[0]));
DateTime to = new DateTime(Convert.ToInt32(txt_to.Text.Split('/')[0]), Convert.ToInt32(txt_to.Text.Split('/')[1]), Convert.ToInt32(txt_to.Text.Split('/')[2]));
if (to > Convert.ToDateTime(DateTime.Now.ToShortDateString()))
{
RegisterClientScriptBlock("alert", "<script>alert('To date can not be later than current date.');</script>");
}
else
{
to = to.AddDays(1);
if (from <= to)
{
SqlParameter[] param = new SqlParameter[]
{
new SqlParameter("@from",from),
new SqlParameter("@to",to),
new SqlParameter("@PortalId",Convert.ToInt32( Session["PortalId"]))
};
Reply
Answers (
8
)
How to change TextBox Name?
coad for how to connect console application to sql server pl