Click here to Skip to main content
15,894,343 members
Home / Discussions / Database
   

Database

 
GeneralRe: Login page Pin
MoustafaS15-May-05 0:32
MoustafaS15-May-05 0:32 
GeneralRe: Login page Pin
Desi Bravo16-May-05 15:35
Desi Bravo16-May-05 15:35 
GeneralRe: Login page Pin
jonathan1516-May-05 1:59
jonathan1516-May-05 1:59 
GeneralRe: Login page Pin
Colin Angus Mackay16-May-05 6:08
Colin Angus Mackay16-May-05 6:08 
GeneralRe: Login page Pin
Desi Bravo16-May-05 15:34
Desi Bravo16-May-05 15:34 
GeneralRe: Login page Pin
Colin Angus Mackay16-May-05 22:04
Colin Angus Mackay16-May-05 22:04 
GeneralSqlDataReader Pin
Member 195262813-May-05 6:35
Member 195262813-May-05 6:35 
GeneralRe: SqlDataReader Pin
Colin Angus Mackay13-May-05 6:56
Colin Angus Mackay13-May-05 6:56 
sadmilson wrote:
I need to know how many records there are in the datareader, is the some way ?

You cannot find this out in advance. You would need to read through all the rows first.

One possible solution, if you need to know the answer in advance of reading the rows is to sent two SQL Statements into the SqlCommand object. The first would be a SELECT COUNT(*) FROM.... Then you would have two result sets in the Data Reader, the first result set would contain the number of rows in the second result set.

Also, I point this out any time I see a potential security concern with code, your code is susceptible to a SQL Injection Attack. You may wish to read this article[^] to find out what that means and how to mitigate the risks.

Does this help?


My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More


GeneralRe: SqlDataReader Pin
Member 195262813-May-05 7:12
Member 195262813-May-05 7:12 
GeneralRe: SqlDataReader Pin
Albert Pascual13-May-05 13:27
sitebuilderAlbert Pascual13-May-05 13:27 
GeneralRe: SqlDataReader Pin
Colin Angus Mackay13-May-05 21:54
Colin Angus Mackay13-May-05 21:54 
GeneralRe: SqlDataReader Pin
Albert Pascual16-May-05 5:35
sitebuilderAlbert Pascual16-May-05 5:35 
GeneralRe: SqlDataReader Pin
Colin Angus Mackay16-May-05 5:42
Colin Angus Mackay16-May-05 5:42 
GeneralRe: SqlDataReader Pin
Albert Pascual16-May-05 5:56
sitebuilderAlbert Pascual16-May-05 5:56 
GeneralRe: SqlDataReader Pin
Colin Angus Mackay16-May-05 6:00
Colin Angus Mackay16-May-05 6:00 
GeneralRe: SqlDataReader Pin
Albert Pascual16-May-05 6:31
sitebuilderAlbert Pascual16-May-05 6:31 
GeneralRe: SqlDataReader Pin
Colin Angus Mackay16-May-05 6:39
Colin Angus Mackay16-May-05 6:39 
GeneralMS Access databases growing endlessly Pin
rocas13-May-05 3:35
rocas13-May-05 3:35 
GeneralRe: MS Access databases growing endlessly Pin
Colin Angus Mackay13-May-05 4:45
Colin Angus Mackay13-May-05 4:45 
GeneralRe: MS Access databases growing endlessly Pin
Desi Bravo13-May-05 11:59
Desi Bravo13-May-05 11:59 
GeneralRe: MS Access databases growing endlessly Pin
rocas17-May-05 0:25
rocas17-May-05 0:25 
GeneralPass array as parameter SQL Procedure Pin
jeetendradhakane13-May-05 1:54
jeetendradhakane13-May-05 1:54 
GeneralAFAIK Pin
niansah13-May-05 1:31
niansah13-May-05 1:31 
GeneralRe: AFAIK Pin
Colin Angus Mackay13-May-05 1:55
Colin Angus Mackay13-May-05 1:55 
GeneralRe: AFAIK Pin
Rob Graham13-May-05 2:43
Rob Graham13-May-05 2:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.