title: Function takes long time for execution
body: <p>Actually, I am trying to find out wheather the partno is existing in the database table or not and it takes long time in  count = checkCommand.ExecuteReader sataement </p>
  
  <p>Please find the method below</p>
  
  <pre><code>Public Function CheckProductNo(ByVal Partno As String) As Boolean
      Dim count As SqlDataReader
      Dim valid As Boolean = False
      Using connection As New SqlConnection
           connection.Open()
          Using checkCommand As New SqlCommand("PartNo_check", connection)
  
              checkCommand.CommandType = CommandType.StoredProcedure
              checkCommand.Parameters.Add(New SqlParameter("@PartNo", Partno))
              count = checkCommand.ExecuteReader
              If count.ToString &gt; 0 Then
                  valid = True
              End If
          End Using
  
      End Using
      Return valid
  
  End Function
  
  
  STORED PROCEDURE
  CREATE PROCEDURE PartNo_Check
  @PartNo VARCHAR(30)
  
  AS
  
  SELECT PartNo from T_Product where PartNo=@Partno
  
  Thanks 
  </code></pre>