| | |
Counting the records of a database
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2008
Posts: 2
Reputation:
Solved Threads: 0
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?
The only thing I want is that the var TotalLinhas remains with the number of records...in this case 7 (seven).
Thanks
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?
VB.NET Syntax (Toggle Plain Text)
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
poguemahone already give the answer to get total records. but if it still redundant use DISTINCT to omitted redundant records.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
you're Welcome 
don't Forget to mark this thread solved...

don't Forget to mark this thread solved...
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
![]() |
Similar Threads
- memory management in wndows 2000 (Windows NT / 2000 / XP)
- Store multiple selection from pagination info into single array (PHP)
- optimistic and pessimistic locking (ASP.NET)
- Collecting Statistics from fields (Visual Basic 4 / 5 / 6)
- Simple Counter Code (ASP)
Other Threads in the VB.NET Forum
- Previous Thread: make a program acept keystrokes even if it is not the active window?
- Next Thread: function in vb.net
| Thread Tools | Search this Thread |
.net .net2008 2008 access advanced application array basic beginner browser button buttons center click client code combo convert cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic eclipse excel exists fade filter forms function generatetags html images input intel internet listview map mobile module monitor msaccess net number objects open panel pdf picturebox picturebox2 port position print printing problem read regex remove right-to-left save search searchvb.net select serial settings shutdown socket sqldatbase sqlserver survey temperature textbox timer timespan transparency txttoxmlconverter user usercontol vb vb.net vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms winsock wpf wrapingcode xml year






