Zdravim, mam takyto problem Mam jednoduchy SqlDataSource
<asp:SqlDataSource ID="sourcePrislusnik" runat="server"
ConnectionString="<%$ ConnectionStrings:PersonalConnectionString %>"
SelectCommand="GetPrislusnik" SelectCommandType="StoredProcedure"
UpdateCommand="UPDATE Prislusnici SET Meno = @Meno WHERE (PrislusniciId = @PrislusniciId) ">
<SelectParameters>
<asp:QueryStringParameter Name="PrislusnikId" QueryStringField="Cislo"
Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Meno" Type="String" />
<asp:Parameter Name="PrislusniciId" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
Ide mi o Update. Takto to vsetko bez problemov funguje. Ale ked zmenim update do ulozenej procedury:
<asp:SqlDataSource ID="sourcePrislusnik" runat="server"
ConnectionString="<%$ ConnectionStrings:PersonalConnectionString %>"
SelectCommand="GetPrislusnik" SelectCommandType="StoredProcedure"
UpdateCommand="EditPrislusnik" UpdateCommandType="StoredProcedure" >
<SelectParameters>
<asp:QueryStringParameter Name="PrislusnikId" QueryStringField="Cislo"
Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Meno" Type="String" />
<asp:Parameter Name="PrislusniciId" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
Tak to vyhodí chybu : Procedure or function EditPrislusnik has too many arguments specified. Pritom ulozena procedura ve podla mna OK Tu je ta ulozena procedura
USE [Personal2]
GO
/****** Object: StoredProcedure [dbo].[EditPrislusnik] Script Date: 11/11/2010 13:17:24 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
ALTER PROCEDURE [dbo].[EditPrislusnik]
-- Add the parameters for the stored procedure here
@Meno nvarchar(50),
@PrislusniciId int
AS
BEGIN
UPDATE Prislusnici
SET Meno = @Meno
WHERE (PrislusniciId = @PrislusniciId)
END
Vobec netusim kde je problem.
|