在ado编程中,model层推荐将对应的变量定义为string 类型,只需在转换为sql变量时加入如下代码

parameters[53].Value = model.date_employed==""?SqlDateTime.Null:DateTime.Parse(model.date_employed);

在其余地方都可直接使用 如下

model.date_employed = txt_date_employed.Text;

 

相关文章:

  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案