Abs
|
Posted: 08/31/2005, 1:19 AM |
|
Hi,
I am trying to do a custom insert using vb.net. It uses stored procedure as follows:
------------------------------------
ALTER PROCEDURE STP_bookDiary
(@fds_user_id [int], @file_id [int], @date_required [datetime], @next_action [char](25) )
AS
DECLARE @result int
BEGIN TRANSACTION
IF EXISTS
(
SELECT NULL
FROM fds_diary WITH (UPDLOCK)
WHERE
fds_user_id = @fds_user_id AND
[file_id] = @file_id AND
date_required = @date_required
)
BEGIN
SELECT @result= -1
END
ELSE
BEGIN
INSERT INTO fds_diary
([fds_user_id], [file_id], date_required, next_action)
VALUES
(@fds_user_id, @file_id, @date_required, @next_action)
SELECT @result =@@ERROR
END
IF @result <> 0
BEGIN
ROLLBACK
END
ELSE
BEGIN
COMMIT
END
RETURN @result
GO
------------------------------------
I keep on getting "Object must implement IConvertible." error when trying to insert into the table.
Please help.
Thanks,
Abs
|
|
|
Abs
|
Posted: 09/02/2005, 8:37 AM |
|
I have been told by CCS that this was a bug in version 3.0.0.45 and to install new release 3.0.0.46 which fixes this problem. Well it didn't and Im really desperate to get this working, please help. Any suggestions?
Thanks
|
|
|
malloc
|
Posted: 09/13/2005, 12:51 PM |
|
I had this problem while using MSADB and fixed it by using the following code: (C# .net beta 2 with nullable double Amount and DBCommandWrapper cmd)
if (Amount == null) cmd.AddInParameter("@Amount", DbType.Double, null); else cmd.AddInParameter("@Amount", DbType.Double, (Double)Amount);
|
|
|
Abs
|
Posted: 09/14/2005, 11:34 AM |
|
Its fixed now, Yes have emailed me a patch which fixes this bug. All working.
|
|
|
G
|
Posted: 10/19/2005, 2:33 PM |
|
Quote Abs:
Its fixed now, Yes have emailed me a patch which fixes this bug. All working.
Hi, any place where one can have access to the said patch? I'm facing the same error, and this is code I haven't touched since 1 yr ago.
Thanks!
|
|
|
ponmudi
|
Posted: 11/29/2005, 12:35 AM |
|
Quote malloc:
I had this problem while using MSADB and fixed it by using the following code: (C# .net beta 2 with nullable double Amount and DBCommandWrapper cmd)
if (Amount == null) cmd.AddInParameter("@Amount", DbType.Double, null); else cmd.AddInParameter("@Amount", DbType.Double, (Double)Amount);
|
|
|
Shashank Kadge
|
Posted: 12/15/2005, 2:44 PM |
|
hi,
I got it working setting CommandType as StoredProcedure.
rds,
Shashank
|
|
|
|