title: how to count the fetched rows by sqldatasource
body: <pre class="lang-vb prettyprint-override"><code>Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
      Dim LoginChecker As New SqlDataSource()
      LoginChecker.ConnectionString = ConfigurationManager.ConnectionStrings("A1ConnectionString1").ToString()
      LoginChecker.SelectCommandType = SqlDataSourceCommandType.Text
      LoginChecker.SelectCommand = "SELECT username FROM A1login WHERE username=@username AND password=@password"
      LoginChecker.SelectParameters.Add("username", username.Text)
      LoginChecker.SelectParameters.Add("password", password.Text)
      Dim rowsAffected As Integer = 0
      Try
          rowsAffected = LoginChecker.&lt;what i have to write here&gt;
      Catch ex As Exception
          'Server.Transfer("LoginSucessful.aspx")
      Finally
          LoginChecker = Nothing
      End Try
      username.Text = rowsAffected
      ' If rowsAffected = 1 Then
      'Server.Transfer("A1success.aspx")
      '   Else
      'Server.Transfer("A1failure.aspx")
      '  End If
  
  End Sub
  </code></pre>
  
  <p>this is the code for login.aspx.vb<br>
    it checks the username and password in the database and redirecrs to respective page on the basis of rows returned. i'm having problem in finding a right function in the sqldatareader namespace so that it counts the number of rows affected. Can anybody tell me the function I should use there? Thanks in advance. </p>