Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling an Update Stored Procedure.
Message
General information
Forum:
ASP.NET
Category:
Visual FoxPro Toolkit for .NET
Miscellaneous
Thread ID:
00674696
Message ID:
00674719
Views:
22
Here is the code.

********* Save Routine *****
' Set up connection and command
Dim oconn As System.Data.OleDb.OleDbConnection
Dim oCommand As New OleDbCommand()

' passing parameter to stored procedure
' I have tried both Char and VarChar for OLEdb
Dim oparam1 As New OleDbParameter("@cssn", OleDb.OleDbType.VarChar)

' gcpuem is a memvar which contains the connectin string
oconn = SqlConnect(gcPuem)

oCommand.CommandType = CommandType.StoredProcedure

' _TestUpdate is the SP being called, code is below.
oCommand.CommandText = "_TestUpdate"

oCommand.Parameters.Clear()
'storing employee ssn, value is 000110000
oparam1.Value = Me.txtcssn.ClipText
oCommand.Parameters.Add(oparam1)

' Bug in ToolKit, should be fixed in future release but need this
' code for now.
oCommand.Connection = oconn

' Tried both of the following lines with the same results.
' gvEmployee = SqlExecute(oconn, oCommand) ', "curEmployee")
SqlExecute(oconn, oCommand)

' Close the connection
SqlDisConnect(oconn)


*** Stored Procedure Code ***

CREATE PROCEDURE _TestUpdate
' Test SP only!
@cssn as char(9)

AS

update pclaim set cssn = @cssn where pid = 2
GO
Fred Lauckner

You know, it works on my computer. I don't know what your problem is.

.Net aint so bad.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform