生日在数据库中的格式是 1980-11-21 00:00:00
我想只输出1980-11-21,为什么下面的代码不行哪?string Select = @"SELECT * FROM clubmember where Enroll=1";SqlDataAdapter adapter = new SqlDataAdapter(Select ,objConnection);
DataSet ds = new DataSet();
adapter.Fill(ds,"InferEngineInfo");foreach(DataRow dr in ds.Tables["InferEngineInfo"].Rows)
{
DateTime dt=DateTime.Parse(dr["birthday"].ToString());
dr["birthday"]=dt.ToShortDateString();.
}datagrid1.DataSource = ds.Tables["InferEngineInfo"].DefaultView;
我想只输出1980-11-21,为什么下面的代码不行哪?string Select = @"SELECT * FROM clubmember where Enroll=1";SqlDataAdapter adapter = new SqlDataAdapter(Select ,objConnection);
DataSet ds = new DataSet();
adapter.Fill(ds,"InferEngineInfo");foreach(DataRow dr in ds.Tables["InferEngineInfo"].Rows)
{
DateTime dt=DateTime.Parse(dr["birthday"].ToString());
dr["birthday"]=dt.ToShortDateString();.
}datagrid1.DataSource = ds.Tables["InferEngineInfo"].DefaultView;
from ...
where ...