我的数据库里面有date,time两个字段,date字段是年月日,time字段是小时和分钟。我想把这两个字段同时显示在dropdoenlist里面。请问怎么实现啊。例如:date是2007-06-25 ,time是12:00:00。在网页的dropdoenlist里显示的是2007-06-25 12:00:00。这个查询语句怎么写??
//获取DataSet
public DataSet SelectSqlSrvRows(string connection,string query)
{
SqlConnection conn = new SqlConnection(connection);
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand(query, conn);
adapter.Fill(dataset);
return dataset;
}
//绑定Dropdoenlist
public void Dropdoenlist_DataBind
{
DataSet dataSet=SelectSqlSrvRows("connection to database string","select date,time from table");
foreach(DataRow row in dataSet.Tables[0].Rows)
{
dropdoenlist.Items.Add(row["date"].ToString()+" "+row["time"].ToString());
}
}