combobox如何绑定datetime类型的数据
在vs2005环境下,三层架构数据层
public static DataSet getValidityByBarcod (string barcode)
{
SqlConnection conn = new SqlConnection(connstr);
string sql = string.Format("select Validity from YpNum where BarCode='{0}'", barcode);
SqlCommand comm = new SqlCommand(sql,conn);
SqlDataAdapter ada = new SqlDataAdapter( );
ada.SelectCommand = comm ;
DataSet ds = new DataSet();
ada.Fill(ds, "Validity");
return ds;
}
业务层
public static DataSet GetValidityByBarcode(string barcode)
{
return SalesService.getValidityByBarcode(barcode);
}
表示层
cmbValidity.DataSource = SalesManager.GetValidityByBarcode(BarCode);
绑定后combobox却显示System.Data.DataRowView