Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple example of a transaction
Message
From
28/03/2006 14:16:48
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 7.0
Miscellaneous
Thread ID:
01108501
Message ID:
01108525
Views:
12
I've never done a RETURN from a SP. Is that just read back into the Data Reader in .NET? Here is the code I use, and I base my results on if there were records affected or not.
        Try
            Conn1.Open()
            DataReader = DeleteCommand.ExecuteReader(CommandBehavior.SingleRow)
        Catch
            Conn1.Close()
            DeleteCommand.Dispose()
            Return -1
        Finally
            Conn1.Close()
            DeleteCommand.Dispose()
        End Try
        If DataReader.RecordsAffected > 0 Then
            Return 1
        Else
            Return 0
        End If
Very fitting: http://xkcd.com/386/
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform