您好,欢迎来到华佗小知识。
搜索
您的当前位置:首页(开发篇) null判断~ .net判断一个对象是否为空的方法(未完待续)

(开发篇) null判断~ .net判断一个对象是否为空的方法(未完待续)

来源:华佗小知识

方法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 { }

未完待续,欢迎补充~

 

转载于:https://www.cnblogs.com/phoenixfling/archive/2012/05/11/2495243.html

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- huatuo0.cn 版权所有 湘ICP备2023017654号-2

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务