如何调用 public int ExecuteSql(string sql, out string errText) 这样的方法?
public int ExecuteSql(string sql, out string errText){
try
{
errText = string.Empty;
DbCommand cmd = DBcnn.CreateCommand();
= CommandType.Text;
= sql;
return cmd.ExecuteNonQuery();
}
catch (System.Exception e)
{
errText = e.Message;
return -1;
}
}
下面是调用
public bool selectByEmail(string email)
{
int rs;
string sql = "select count(*) from EcrdAccount where email="+email;
rs = sqlHelper.ExecuteSql(sql, ??? );//这里怎么写?
return rs > 0;
}