我正在将一些日期值插入到数据库中。我使用System.DateTime.ToString();
功能。本功能可以插入日期和时间在一起,但我不希望我的时间。如何能节省时间只能在数据库 我按一下按钮是如何只将日期插入到数据库中
protected void Button1_Click1(object sender, EventArgs e)
{
int i = CheckBox1.Checked ? 1 : 0;
try
{
string str=mas.empdetadd(ddid.SelectedItem.Text,Convert.ToDateTime(txtdate.Text));
}
}
请阅读此文章:[自定义日期和时间格式](http://msdn.microsoft.com/en-us/library/8kb3ddd4(v = vs.110).aspx)Ps令人不安的问题询问有关插入日期作为字符串,但在代码转换字符串日期时间。 – Reniuz 2014-09-26 08:26:19