number of affected rows
-
When I make a query in sql server 2005 like "SELECT something FROM somewhere", there is a way to know the number of selected rows without the need of other query "SELECT COUNT(*) FROM somewhere" ? Thanks
-
When I make a query in sql server 2005 like "SELECT something FROM somewhere", there is a way to know the number of selected rows without the need of other query "SELECT COUNT(*) FROM somewhere" ? Thanks
This is returned automatically unless the SELECT statement is preceded by a
SELECT NOCOUNT ON
statement. This is not applicable to Access databases though. Jet doesn't support returning the "number of rows affected". What is it your're trying to do. So far, this question has nothing to do with VB.NET... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome -
This is returned automatically unless the SELECT statement is preceded by a
SELECT NOCOUNT ON
statement. This is not applicable to Access databases though. Jet doesn't support returning the "number of rows affected". What is it your're trying to do. So far, this question has nothing to do with VB.NET... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming GnomeI want to redim an array to the number of rows selected, and fill this array from one of the columns of the query.
-
I want to redim an array to the number of rows selected, and fill this array from one of the columns of the query.
Then you're looking in the wrong place. Fill your DataSet, DataTable, or whatver your using to store the results of the query. Then use the count of the number of Rows in the collection to set your array dimensions.
Dim ds As DataSet
' code to fill DataSet with a couple of tables...
Dim arraySize As Integer
arraySize = ds.Tables("whatever").Rows.Count
Dim myArray(arraySize) As String
.
.
.RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Then you're looking in the wrong place. Fill your DataSet, DataTable, or whatver your using to store the results of the query. Then use the count of the number of Rows in the collection to set your array dimensions.
Dim ds As DataSet
' code to fill DataSet with a couple of tables...
Dim arraySize As Integer
arraySize = ds.Tables("whatever").Rows.Count
Dim myArray(arraySize) As String
.
.
.RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Yes, you are right. I was working with a not too good method. With a dataset it's better implemented. Thanks a lot.
-
Yes, you are right. I was working with a not too good method. With a dataset it's better implemented. Thanks a lot.
No problem! :-D RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome