2007年12月28日 星期五

如何呼叫 Customer_Remove Stored Procedure,並且讀取傳回值和輸出參數 vCount

SqlParameter[] paramList = new SqlParameter[]{
new SqlParameter ("@vcApplicationConstName", "abc"),
new SqlParameter ("@iApplicationID", SqlDbType.VarChar,50),
new SqlParameter ("@Return", SqlDbType.Int)
};
((SqlParameter)paramList[1]).Direction = ParameterDirection.Output;
((SqlParameter)paramList[2]).Direction = ParameterDirection.ReturnValue ;

int a= SQLHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, "sp_BSQ_GetApplicationID", paramList);
Response.Write(a);
Response.Write("
iApplicationID=");
Response.Write(((SqlParameter)paramList[1]).Value);
Response.Write("
Returnvalue=");

Response.Write(((SqlParameter)paramList[2]).Value);




參考網址:http://www.mugua.net/vbgl/com/205004.htm

沒有留言: