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
Deekshaa Singh Chauhan
NA
178
32.6k
how to solve date string not in correct format
Jul 12 2018 5:19 AM
protected
void
btnUpdate_Click1(
object
sender, EventArgs e)
{
//TextBox txtISIN = (TextBox)grdLabEntry.Rows[0].FindControl("txtISINNumber");
TextBox txtGrade = (TextBox)grdLabEntry.Rows[0].FindControl(
"txtGrade"
);
TextBox txtValidity = (TextBox)grdLabEntry.Rows[0].FindControl(
"txtValidity"
);
TextBox txtFED = (TextBox)grdLabEntry.Rows[0].FindControl(
"txtFED"
);
//DMatEntry obj = new DMatEntry();
SpotEntry obj =
new
SpotEntry();
obj.SpotEntryId = RId;
//obj.ISINNumber = txtISIN.Text;
obj.Grade = txtGrade.Text;
obj.Validity = Convert.ToDateTime(txtValidity.Text);
obj.FEd = Convert.ToDateTime(txtFED.Text);
int
result = SpotEntry.UpdateLabEntry(obj);
if
(result > 0)
{
grdLabEntry.EditIndex = -1;
obj.SpotEntryId = RId;
DataTable dt = SpotEntry.GetAllDmatRecordsById(obj);
if
(dt.Rows.Count > 0)
{
showmsg(
"Dmat Lab Entry Updated Successfully."
);
grdLabEntry.DataSource = dt;
grdLabEntry.DataBind();
}
}
how to solve date string is not recognize as a valid date.
actully when insert date it take dd/mm/yyyy but when i select date greater then 12 it throw error date string not valid date because it understand dd /mm/yyyy to mm/dd/yyyy
so what can i do to solve this.
above is my code which i add in aspx file
Reply
Answers (
8
)
How to bind HTML Helper using Angular JS in MVC5
Refresh TreeList on tab change in DevExtreme MVC