-1

Hi there!

I've a problem...want to return the total number of rows affected by the statement "SELECT * FROM Producao WHERE ProdUserID=UtilizadorID" can anybody give a look to the code below?

Dim ProdUserID As String = "samurai"
        Dim ProducaoSource As New SqlDataSource()
        ProducaoSource.ConnectionString = ConfigurationManager.ConnectionStrings("seaempiresdbConnectionString1").ToString()
        ProducaoSource.SelectCommandType = SqlDataSourceCommandType.Text
        ProducaoSource.SelectCommand = "SELECT * FROM Producao WHERE ProdUserID=UtilizadorID"
        Dim TotalLinhas As Integer = 0
        Try
            TotalLinhas = ProducaoSource.Select()
        Finally
        End Try

The only thing I want is that the var TotalLinhas remains with the number of records...in this case 7 (seven).

Thanks

3
Contributors
4
Replies
8
Views
10 Years
Discussion Span
Last Post by Jx_Man
0

Try:

SELECT COUNT(*) FROM Producao WHERE ProdUserID=UtilizadorID.

This will give the number of rows that meet this criteria.

0

poguemahone already give the answer to get total records. but if it still redundant use DISTINCT to omitted redundant records.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.