Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling an Update Stored Procedure.
Message
Information générale
Forum:
ASP.NET
Catégorie:
Visual FoxPro Toolkit pour .NET
Divers
Thread ID:
00674696
Message ID:
00674719
Vues:
23
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform