I have a table in a database that I can query using asp.net page and return all results successfully, but I also want to return the row count of a specific column and simply display the total number of rows on an Asp.net page so I can calculate percentage of certain repeated words under this column
I have included an extract from the code. When I add the count bit, an indexoutbound error is displayed. note without the count, everything works. Any ideas?
cmdSelectAuthors = New SqlCommand("Select *, count (column1) as ColumnData from table1 where conditions ", conPubs )
dtrAuthors = cmdSelectAuthors.ExecuteReader()
Response.Write( dtrAuthors( "ColumnData" ) ) = this should display the total count of rows of column1
End While Loop
Thanks in advance