方法1~ !string.IsNullOrEmpty()
1 if (!string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.QueryString["id"])) 2 { 3 Convert.ToInt32(Request.QueryString["id"]); 4 }
方法2~ try{} catch{}
1 try 2 { 3 model_weekplandetails.constructiion_complete_time = DateTime.Parse(ds.Tables[0].Rows[i]["constructiion_complete_time"].ToString()); 4 } 5 catch { }
未完待续,欢迎补充~