how i want to calculate the total of row in the database Access using vb.net ??
i very headache about it
thanx ~!
Printable View
how i want to calculate the total of row in the database Access using vb.net ??
i very headache about it
thanx ~!
Dear friend, I'm learning to use VB.NET, but perhaps I can help you. I suppose you use JET OLEDBProvider and ADO. You can:
Use an SQL Query like: "SELECT COUNT("NameOfAField") AS TotalRow FROM TabGOOFY"
Or, if you like me, use an ADODB.Recordset, you can simply:
Dim TotalRow as Integer=Rst.recordcount
Caution!!! This method (just as ".AbsolutePosition"), for my experience, works properly only with Static or Keyset cursor.
Dynamic, for example, is accepted sintatically, but it will be immediately converted to Keyset, without a message, but in this case sometimes does not work fine and the method will give you always -1
Strange, isn't it?:)
thank you for your help
i go to try 1
thanx
Hi,
If your query is not sorted yet, what do you mean by
"how i want to calculate the total of row in the database Access "
the total number of rows in a database? or
the total number of rows in a table? or
the total value of all the fields in a row of a database table?
If either of the first two, if you want to do it when you have loaded then into a dataset etc you preface your code with
iCount =