Dim oConnection As SqlConnection = New SqlConnection()
Dim oConnection As SqlCommand = New SqlCommand()
Dim oDataReader As SqlDataReader
oConnection.Open()
oCommand.CommandType = CommandType.StoredProcedure
oCommand.CommandText = "storedProcedureName"
oCommand.Connection = oConnection
Dim oParameter1 As SqlParameter = oCommand.Parameters.Add("@iInteger", SqlDbType.Int)
oParameter1.Value = 1
oDataReader = oCommand.ExecuteReader()
While (oDataReader.Read())
If the stored procedure does not return rows "oDataReader" is unnecessary
and a call to "oCommand.ExecuteNonQuery()" or "oCommand.ExecuteScalar()"
should be used instead
End While
oDataReader.Close()
oConnection.Close()