我有一個調用異步方法Web服務:拉什Webservice的衝突價值觀
public Response Method1(Request request)
{
new StaticClass.ProcessAsync(request);
return new Response
{
result = 0,
resultDescription = "success"
};
}
裏面的方法ProcessAsync(Request request)
我從數據庫中選擇:
- 一個ConnectionString的
存儲過程名稱
並執行該存儲過程。
連接字符串的值和存儲過程的費用取決於Request類值:
Settings settings = GetInfoFromDatabase(request);
string conString = settings.ConnectionsString;
string storedProcedureName = settings.StoredProcedureName;
//execute stored procedure
當有對Web服務請求的倉促,我收到以下錯誤很多:
System.Data.SqlClient.SqlException (0x80131904): Could not find stored procedure 'storedprocedurename'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
可能是什麼問題?難道它會因急於設置類的值而發生衝突嗎?
請提供'StaticClass.ProcessAsync()'和'GetInfoFromDatabase()'方法的完整代碼。這似乎是併發問題,但沒有辦法找出沒有看代碼。爲什麼你使用'new'關鍵字? ProcessAsync是一個類,你調用構造函數? –