Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Releasing a Parameter from a Command
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Visual FoxPro Toolkit pour .NET
Titre:
Releasing a Parameter from a Command
Divers
Thread ID:
00766718
Message ID:
00766718
Vues:
45
Never mind. Intellisense pointed the way to the oCommand.paramters.clear()



I'm hoping to reuse a command object that was previous defined (code below). The first time I use it, I assign three parameters. The next time I want to use it, I only need to have one parameter, is there a way to release the paramters already assigned:

Thanks
        Dim oConn As System.Data.OleDb.OleDbConnection
        Dim oCommand As New OleDbCommand()

        oCommand.CommandText = "ct_DisplaySchedule2"
        oCommand.CommandType = CommandType.StoredProcedure

        'Create a new parameter and add it to the parameters collection
        Dim oParam1 As New OleDbParameter("@ttStartTime", OleDb.OleDbType.Date)
        oParam1.Value = MyDate1
        oCommand.Parameters.Add(oParam1)

        Dim oParam2 As New OleDbParameter("@ttEndTime", OleDb.OleDbType.Date)
        oParam2.Value = MyDate2
        oCommand.Parameters.Add(oParam2)

        Dim oParam3 As New OleDbParameter("@tiDeptID", OleDb.OleDbType.Integer)
        oParam3.Value = gnDeptID
        oCommand.Parameters.Add(oParam3)
Répondre
Fil
Voir

Click here to load this message in the networking platform