0
我有需要用parameter..But一個存儲過程,該存儲過程犯規得到執行將SqlDataSource ...發送變量的SqlDataSource
我是否傳遞參數成功?
的SqlDataSource:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:CP_AllQuestionsAnswered %>"
SelectCommand="GetMessagesTitles" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter Name="Name" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
背後的頁面加載代碼:
string name = ModeratorUsefulFunctions.GetMessageUsersName(g);
SqlDataSource1.SelectParameters.Add("@Name", name);
存儲過程:
ALTER PROCEDURE dbo.GetMessagesTitles
@Name nvarchar(50)
AS
SELECT MessageTitle, MessageID
FROM Messages
WHERE [email protected]
由於它的工作...裏的「n」應該是「N」。這校正situation..The答案是right..thanks – Matrix001
歡迎您人 !!! –