I am using the update feature in a gridview in ASP.NET 2005
I am passing parameters to a Stored procedure which seems to work, but when the page is loading up again I get the error
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: Input string was not in a correct format.
If I close the page and reopen it, it has the new values so it did update.
I think my problem might be coming from my DDL and my stored procedure because when I tried to make the value of my ddl Type_ID it crashed everytime so I had to make the text = Type_Name and the value Type_Name then I got the ID in my stored procedure.
So I am including my Stored procedure
CREATE PROCEDURE DBO.UPDATE_REMARKS
-- Add the parameters for the stored procedure here
@TICK_ID VARCHAR(25),
@DATE VARCHAR(50),
@REMARK_TYPE VARCHAR(50),
@NOTES VARCHAR(1000)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DECLARE @REMARK_ID VARCHAR(50)
SET @DATE = (SELECT CONVERT(VARCHAR, CONVERT(DATETIME, @DATE, 101), 101))
SET @REMARK_ID = (SELECT TICK_TYPE_ID FROM TICK_TYPE WHERE TICK_NAME = @REMARK_TYPE)
UPDATE TICKS SET TICK_DATE = @DATE, TICK_TYPE_ID = RTRIM(@REMARK_ID), NOTES = @NOTES WHERE TICK_ID = @TICK_ID
END
GO
Any help would be greatly appreciated.
Thanks in advance
I am passing parameters to a Stored procedure which seems to work, but when the page is loading up again I get the error
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: Input string was not in a correct format.
If I close the page and reopen it, it has the new values so it did update.
I think my problem might be coming from my DDL and my stored procedure because when I tried to make the value of my ddl Type_ID it crashed everytime so I had to make the text = Type_Name and the value Type_Name then I got the ID in my stored procedure.
So I am including my Stored procedure
CREATE PROCEDURE DBO.UPDATE_REMARKS
-- Add the parameters for the stored procedure here
@TICK_ID VARCHAR(25),
@DATE VARCHAR(50),
@REMARK_TYPE VARCHAR(50),
@NOTES VARCHAR(1000)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DECLARE @REMARK_ID VARCHAR(50)
SET @DATE = (SELECT CONVERT(VARCHAR, CONVERT(DATETIME, @DATE, 101), 101))
SET @REMARK_ID = (SELECT TICK_TYPE_ID FROM TICK_TYPE WHERE TICK_NAME = @REMARK_TYPE)
UPDATE TICKS SET TICK_DATE = @DATE, TICK_TYPE_ID = RTRIM(@REMARK_ID), NOTES = @NOTES WHERE TICK_ID = @TICK_ID
END
GO
Any help would be greatly appreciated.
Thanks in advance