tryDataSet1.Tables["t1"].Rows[gbRow]["store_date"] = DBNull.Value;

解决方案 »

  1.   

    出現如下:Cannot implicitly convert type 'System.DBNull' to 'System.DateTime'
      

  2.   

    weird, the following works:         DataTable dt = new DataTable();
    DataColumn dc = new DataColumn("DT",typeof(DateTime));
    dt.Columns.Add(dc);
    DataRow dr = dt.NewRow();
    dr["DT"] = DBNull.Value;
    dt.Rows.Add(dr);
    try to assign it new DateTime(1,1,1);
      

  3.   

    also try.... = Convert.ToDateTime(null);
      

  4.   

    它是{1/1/1}﹐將它傳給后台存貯過程出錯.
    同PB中的 DateTime dt1;  setnull(dt1)對應的C#語句是什么?
      

  5.   

    gbRow.store_date = null;???你这是类型化的DataSet么???如果是这样,你应该使用:1.gbRow["store_date"] = System.Convert.DBNull;2.gbRow.Setstore_dateNull();