Avatar of RIAS
RIAS
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Parameter for stored procedure

Hello,

I am trying to speed up the execution time for
 Dim param As New SqlParameter()
                param.Direction = ParameterDirection.ReturnValue
                param.ParameterName = "returnValue"

                add to parameter to collection
                 .Parameters.Add(param)


                .CommandType = CommandType.StoredProcedure
                .Connection = MedicalSQL.GetConnection
                .ExecuteNonQuery()

Open in new window

There is sight suggesting using

Public Sub InsertXML(TheXML As String)
    Using objConn As New SqlConnection(DBConnectionString())
        objConn.Open()
        Using objCmd As New SqlCommand("dbo.ProductsAccessXMLInsert")
            objCmd.CommandType = CommandType.StoredProcedure
            objCmd.Connection = objConn
            objCmd.Parameters.Add("ValidXMLInput", SqlDbType.Xml)
            objCmd.Parameters(0).Value = TheXML
 
            objCmd.ExecuteNonQuery()
        End Using
        objConn.Close()
    End Using
End Sub

Open in new window

 

Any suggestions on how can i implement this ?
Visual Basic.NET.NET Programming

Avatar of undefined
Last Comment
AndyAinscow

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
AndyAinscow

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
RIAS

ASKER
Thanks Andy, just trying and then  will compare the speed
SOLUTION
Ramkisan Jagtap

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
AndyAinscow

Huh !   :-(

I did say you need to determine what is taking the time.
RIAS

ASKER
Sorry Andy...will split points
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
AndyAinscow

Not necessary but please read carefully in future.  (You might get a change in total time by changing things in the VB code, it really depends on how long each bit takes.)