1.
string sql = string.Format("select Id,NickName,Age,Sex from users where Id='{0}' and NickName='{1}'", id, nickname);2.
string sql = string.Format("select Id,NickName,Age,Sex from users where Id='{0}' or NickName='{1}'", id, nickname);3.
string sql = string.Format("select Id,NickName,Age,Sex from users where Id='{0}', id);数据库进行查找时那条语句的效率会搞点呢!!
string sql = string.Format("select Id,NickName,Age,Sex from users where Id='{0}' and NickName='{1}'", id, nickname);2.
string sql = string.Format("select Id,NickName,Age,Sex from users where Id='{0}' or NickName='{1}'", id, nickname);3.
string sql = string.Format("select Id,NickName,Age,Sex from users where Id='{0}', id);数据库进行查找时那条语句的效率会搞点呢!!
set statistics io on
----语句
set statistics io off
测试一下..