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
Nandha Kumar Nagarajan
NA
284
57.2k
how to convert datetime to time sapn
May 7 2019 9:18 AM
hi friends
protected void btn_valid_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationManager.ConnectionStrings["Const"].ToString();
SqlCommand cmd = new SqlCommand("VALL", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@EMP_ID", SqlDbType.Int).Value = int.Parse (txt_emp_id.Text);
cmd.Parameters.Add("@IN_TIME", SqlDbType.Time).Value = Convert.ToDateTime (txt_present_In_time.Text);
cmd.Parameters.Add("@OUT_TIME", SqlDbType.Time).Value = Convert.ToDateTime (txt_present_out_time.Text);
cmd.Parameters.Add("@OUTPUT_PARA", SqlDbType.VarChar, 20);
cmd.Parameters["@OUTPUT_PARA"].Direction = ParameterDirection.Output;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
lbl_rect_err_msg.Text = cmd.Parameters["@OUTPUT_PARA"].Value.ToString();
}
ERROR MESSAGE::
Additional information: Failed to convert parameter value from a DateTime to a TimeSpan.
HELP ME!!!!!!!!!!!
Reply
Answers (
2
)
How to Create Push Notification
Bind data to dropdownlist and selectedvalue by C#