I don't think that is where i've gone wrong?

Pamela Ng replied at 24-Dec-05 09:29
Hi

I don't have identity as a data type.

Is uniqueidentifier data type the same as identity?

Btw, i thought the identity datatype is set in the stored procedure?

This is my stored procedure code:

ALTER PROCEDURE spInsertRating(@RatingReviewID VARCHAR OUTPUT, @Title VARCHAR(50), @Rating INT,
@Review VARCHAR(MAX), @ProductID VARCHAR(50), @Username VARCHAR(50))

AS

INSERT INTO ProductRatingAndReview(Title, Rating, Review, ProductID, Username)
VALUES (@Title, @Rating, @Review, @ProductID, @Username)
SET @RatingReviewID = SCOPE_IDENTITY()

RETURN


I think the way i declare at my codings for my 'page behind code' is wrong?  Have to use data reader to retrieve the auto generated value?


Here are my codings in .NET again:

In .NET, for RatingReviewID, i have this: 

'Adds the specified parameter object to the SQL parameter collection 

myParm = dbCmd.Parameters.Add( "@RatingReviewID" , SqlDbType.SmallInt) 

myParm.Direction = ParameterDirection.Output 



and when executing the stored procedure: 

Try 

dbConn.Open() 

dbCmd.ExecuteNonQuery() 

Dim RatingReviewID As String = dbCmd.Parameters( "@RatingReviewID" ).Value 

MsgBox( "Opinion successfully added!" , MsgBoxStyle.Information, "Product Rating" ) 



dbConn.Close() 


Any ideas on what is wrong?  How to change my codings to get it right?  I've been very stuck at this for a very very long time =(.


Click here to sign in and reply. You could earn money via our $500 contest just for being helpful.
  Auto Generated Value In Stored Procedure - Pamela Ng  24-Dec-05 07:34 7:34:27 AM
      Identity Column - F Cali  24-Dec-05 08:37 8:37:23 AM
          What is identity column? - Pamela Ng  24-Dec-05 08:56 8:56:57 AM
              Identity Column - F Cali  24-Dec-05 09:00 9:00:24 AM
                  I don't think that is where i've gone wrong? - Pamela Ng  24-Dec-05 09:29 9:29:45 AM
                      Check the - Aarthi Saravanakumar  24-Dec-05 12:54 12:54:07 PM
                      Identity Not A Data Type - F Cali  24-Dec-05 01:02 1:02:32 PM
                          OUTPUT same as IDENTITY? - Pamela Ng  24-Dec-05 10:24 10:24:26 PM
                              No - Aarthi Saravanakumar  24-Dec-05 10:35 10:35:25 PM
                                  I do already have INT OUTPUT in stored procedure - Pamela Ng  24-Dec-05 10:42 10:42:18 PM
                                      Change Table Definition - F Cali  24-Dec-05 11:54 11:54:31 PM
                                          Table definition does not have IDENTITY col type - Pamela Ng  25-Dec-05 03:15 3:15:00 AM
                                              Another Property Not DataType - F Cali  25-Dec-05 11:31 11:31:34 PM
                                      You have to change it - Aarthi Saravanakumar  25-Dec-05 10:20 10:20:52 AM
                              Identity Column - F Cali  24-Dec-05 11:56 11:56:27 PM
View Posts

promotion
Silverlight    WPF    WCF    WWF    LINQ   
JavaScript    AJAX    ASP.NET    XAML   
C#    VB.NET    VB 6.0    GDI+    IIS    XML   
.NET Generics    Anonymous Methods    Delegate   
Visual Studio .NET    Expression Blend    Virus   
Windows Vista    Windows XP    Windows Update   
Windows 2003 Server    Windows 2008 Server   
SQL Server    Microsoft Excel    Microsoft Word   
SharePoint    BizTalk    Virtual Earth   
.NET Compact Framework    Web Service   


"Everything" RSS / ATOM Feed Parser
How to send and receive messages through message queuing in .Net
How to Read text file as database
SQL Server 2005 Paging Performance Tip
Display code of web page.
Fully Scalable Excel File Importer class for .net using Microsoft Jet driver
Generic Chart Color Manager class that can be used for any charts
Helper class to style the infragistics wingrid
Using Reflection to detemine as Assembly Info in and out.
Helper class to play with Window (Owners and position)
Resolving displayname from the culture using the XmlLanguage and LanguageSpecificStringDictionary class