I am having problem with my UPDATE in GridView, it is saying that I have too many argument, I don't
This happens when I click the UpdateCommand in GRIDVIEW
Procedure or function UpdateCountry has too many arguments specified.
<asp:SqlDataSource ID="mySqlDataSource" Runat="server"SelectCommandType="StoredProcedure" SelectCommand="ShowCountry"
UpdateCommandType="StoredProcedure" UpdateCommand="UpdateCountry"
ConnectionString="<%$ ConnectionStrings:ConnString %>">
<UpdateParameters>
<asp:Parameter Type="String" Name="CountryName"></asp:Parameter>
<asp:Parameter Type="String" Name="CountryID"></asp:Parameter>
</UpdateParameters>
</asp:SqlDataSource
Just In case these are my Stored Procedures
**************************************************************************
CREATE PROCEDURE [dbo].[UpdateCountry]
@.CountryName varchar(50),
@.CountryID varchar(50)
AS
UPDATE EkeanyanwuO.tCountry SET [CountryName] = @.CountryName WHERE [CountryID] = @.CountryID
GO
************************************************************************************
CREATE PROCEDURE [dbo].[ShowCountry] AS
SELECT TOP 100 PERCENT EkeanyanwuO.tIMSREGION.ImsRegionName AS ImsRegionName, EkeanyanwuO.tCountry.CountryName AS CountryName,
EkeanyanwuO.tIMSREGION.ImsRegionID AS ImsRegionID, EkeanyanwuO.tCountry.CountryID AS CountryID
FROM EkeanyanwuO.tCountry INNER JOIN
EkeanyanwuO.tIMSREGION ON EkeanyanwuO.tCountry.ImsRegionID = EkeanyanwuO.tIMSREGION.ImsRegionID
ORDER BY EkeanyanwuO.tCountry.CountryName
GO
************************************************************************************
The ConflictDetection property of DataSource set to OverrideChanges. The problem will be solved. :D
No comments:
Post a Comment