string strQuery = "proc_SelectUserInfo '" + strUsername + "','" + strPwd + "','" + ipaddress + "',0";
objUserInfo = objSelectUserInfoRepository.ExecuteProcReturnList(strQuery);
/// </summary>
/// <param name="strProcedure">过程名称,比如:【ExecuteProcReturnList(Proc_SelectUser 10)】</param>
/// <returns>匿名对象组</returns>
public virtual IList<T> ExecuteProcReturnList(string strProcedure)
{
try
{
using (var session = GetSession("write").OpenSession())
{
string strQuery = " execute dbo." + strProcedure;
return CreateSQLQuery(strQuery);
}
}
catch (Exception ex)
{
logger.Error(ex.ToString());
return null;
}
}
public virtual IList<T> CreateSQLQuery(string strQuery)
{
using (var session = GetSession("write").OpenSession())
{
try
{
strQuery = strNocounton + strQuery;
return session.CreateSQLQuery(strQuery).AddEntity(typeof(T).Name, typeof(T)).List<T>();
}
catch (Exception ex)
{
throw new Exception(ex.Message.ToString());
}
}
}
错误提示:
could not execute query
[ set nocount on; execute dbo. proc_SelectUserInfo '0482','2941F1362692D47B','::1','0' ]
[SQL: set nocount on; execute dbo. proc_SelectUserInfo '0482','2941F1362692D47B','::1','0']
有时候又没有任何错误提示,也得不到任何 数据,是为什么?大咖门,出来了
大咖来指点下哈。
先看看数据库有没有锁表