个人总结

1.如何学习一个新项目:  a)在VS中查看项目的依赖了解项目的引用关系

                                 b)明确高层依赖低层即调用低层

2.关于代码:

     1)convert.tox()会有异常抛出需try,建议直接用tox() 如todecimal()

     2)switch处理分支比if更好

     3)引用类型对象使用前判断null   if (prams != null)

     4)语句的换行书写

        cmd.Parameters.Add(

              new SqlParameter(RETURNVALUE, SqlDbType.Int,4,ParameterDirection.ReturnValue,

              false,0,0,string.Empty, DataRowVersion.Default,null));

     5)输出参数需在catch快中给其赋予null       catch{ datareader = null;}

     6)字符串初始值  string result=string.Empty;

     7)

原文地址:https://www.cnblogs.com/tiantianle/p/4770746.html