title: VB.Net: Code to find the number of rows in a table does not work correctly
body: <p>I have this function that should return 1 if the id exists and 0 if not.
  When debugging I found that the query sent to sqlserver is correct and returns 1 row, also I see 1 in the ds Table count =1 but the function returns 0. 
  Is there a better way to do this ? And what is the problem?</p>
  
  <pre><code>Public Function check_id() As Integer
      Try
          connexion = New SqlConnection(chaine_de_connexion)
          da = New SqlDataAdapter("select * from table_x where id=5", connexion)
          ds = New DataSet
          da.Fill(ds, "Info")
          If ds.Tables("Info").Rows.Count &gt; 0 Then
            Return 1
          Else
            Return 0
          End If
      Catch ex As Exception
         Return 0
      End Try
  End Function
  </code></pre>