Click here to Skip to main content
15,887,135 members
Home / Discussions / Database
   

Database

 
AnswerRe: How to write the Query Pin
Het210922-Nov-05 19:02
Het210922-Nov-05 19:02 
AnswerRe: How to write the Query Pin
Frank Kerrigan24-Nov-05 4:11
Frank Kerrigan24-Nov-05 4:11 
QuestionCount of Rows Returned Pin
kenexcelon21-Nov-05 17:39
kenexcelon21-Nov-05 17:39 
AnswerRe: Count of Rows Returned Pin
Colin Angus Mackay21-Nov-05 20:42
Colin Angus Mackay21-Nov-05 20:42 
GeneralRe: Count of Rows Returned Pin
kenexcelon21-Nov-05 21:03
kenexcelon21-Nov-05 21:03 
GeneralRe: Count of Rows Returned Pin
Colin Angus Mackay21-Nov-05 22:45
Colin Angus Mackay21-Nov-05 22:45 
GeneralRe: Count of Rows Returned Pin
kenexcelon22-Nov-05 6:45
kenexcelon22-Nov-05 6:45 
GeneralRe: Count of Rows Returned Pin
Colin Angus Mackay22-Nov-05 8:13
Colin Angus Mackay22-Nov-05 8:13 
Dim cmd As SqlCommand
cmd = SqlCommand.New()
cmd.CommandText = "SELECT COUNT(*) FROM MyTable WHERE someColumn=@someValue"
cmd.Connection = myConnection
Dim numRows As Int
numRows = cmd.ExecuteScalar()


numRows will contain the number of rows that match the given filter (i.e. what is filtered in the WHERE clause). COUNT() is an aggregate function that returns a count, when COUNT(*) is used it returns the number of rows. If you use COUNT(columnName) then it will count the number of rows where the column value is not null.

Does this help?


My: Blog | Photos

"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious


GeneralRe: Count of Rows Returned Pin
anandss23-Nov-05 8:43
anandss23-Nov-05 8:43 
Questionexcel and sql Pin
vandread121-Nov-05 13:14
vandread121-Nov-05 13:14 
AnswerRe: excel and sql Pin
Colin Angus Mackay21-Nov-05 13:24
Colin Angus Mackay21-Nov-05 13:24 
AnswerRe: excel and sql Pin
S Douglas22-Nov-05 0:52
professionalS Douglas22-Nov-05 0:52 
QuestionHEL.... P HEL....p p Pin
7mam21-Nov-05 8:38
7mam21-Nov-05 8:38 
AnswerRe: HEL.... P HEL....p p Pin
albCode14-Dec-05 21:47
albCode14-Dec-05 21:47 
Questionsend report via mail daily! Pin
imshally8120-Nov-05 20:58
imshally8120-Nov-05 20:58 
AnswerRe: send report via mail daily! Pin
WoutL21-Nov-05 5:51
WoutL21-Nov-05 5:51 
GeneralRe: send report via mail daily! Pin
imshally8127-Nov-05 19:43
imshally8127-Nov-05 19:43 
QuestionDifference between records Pin
(Steven Hicks)n+120-Nov-05 19:37
(Steven Hicks)n+120-Nov-05 19:37 
AnswerRe: Difference between records Pin
Michael Potter21-Nov-05 4:09
Michael Potter21-Nov-05 4:09 
QuestionQuery to insert datas from Remote System's Sql Server Pin
Rajkamal_dfine20-Nov-05 18:26
Rajkamal_dfine20-Nov-05 18:26 
AnswerRe: Query to insert datas from Remote System's Sql Server Pin
WoutL21-Nov-05 5:39
WoutL21-Nov-05 5:39 
Questionsql - Dynamic ID creations Pin
UK_NAIR20-Nov-05 17:56
UK_NAIR20-Nov-05 17:56 
AnswerRe: sql - Dynamic ID creations Pin
Stanciu Vlad20-Nov-05 22:47
Stanciu Vlad20-Nov-05 22:47 
QuestionProblems Formating Datagrid Output Pin
TofuBug2420-Nov-05 14:21
TofuBug2420-Nov-05 14:21 
AnswerRe: Problems Formating Datagrid Output Pin
Stanciu Vlad20-Nov-05 22:41
Stanciu Vlad20-Nov-05 22:41 

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.