C#(2017-04-19)

来源:互联网 发布:js数组对象转json 编辑:程序博客网 时间:2024/06/05 08:55

SQL语句,查询数据库里是否存在某个表
select count(1) from sys.objects where name = ‘表名’

select ObjectProperty(Object_ID( ‘表名’),’IsUserTable’)

这两个SQL语句都是查询数据库里头是否存在某个表的语句,


获取C#代码执行的时间(精确到毫秒)
using System.Diagnostics;//引用相关的命名空间
Stopwatch st=new Stopwatch ();//实例化类
st. Start();//开始计时

//需要统计时间的代码段

st.Stop();//终止计时
Response.Write(st.ElapsedMilliseconds.ToString());//输出时间。输出运行时间:>Elapsed,带毫秒的时间:ElapsedMilliseconds
//Response.Write是asp .net中使用的输出


C#计算一段程序运行时间的三种方法
http://blog.csdn.net/xzjxylophone/article/details/6832160


这里写图片描述

0 0