Click here to Skip to main content
15,897,371 members
Home / Discussions / Database
   

Database

 
AnswerRe: Printing "Yes" /"No" from sql 0/1? Pin
ToddHileHoffer23-Nov-05 2:22
ToddHileHoffer23-Nov-05 2:22 
QuestionConverting datetime to Desired format? Pin
majidbhutta23-Nov-05 1:32
majidbhutta23-Nov-05 1:32 
AnswerRe: Converting datetime to Desired format? Pin
ToddHileHoffer23-Nov-05 2:21
ToddHileHoffer23-Nov-05 2:21 
AnswerRe: Converting datetime to Desired format? Pin
Luis Alonso Ramos27-Nov-05 8:33
Luis Alonso Ramos27-Nov-05 8:33 
Questionsave image in MsSql 2000 database Pin
yourgangu22-Nov-05 20:52
yourgangu22-Nov-05 20:52 
QuestionHelp with dynamic sql Pin
Het210922-Nov-05 18:06
Het210922-Nov-05 18:06 
NewsRe: Help with dynamic sql Pin
jescgf22-Nov-05 18:38
jescgf22-Nov-05 18:38 
GeneralRe: Help with dynamic sql Pin
Het210922-Nov-05 18:58
Het210922-Nov-05 18:58 
AnswerRe: Help with dynamic sql Pin
Colin Angus Mackay23-Nov-05 3:25
Colin Angus Mackay23-Nov-05 3:25 
QuestionSQL 2005 Express? Pin
Paul Conrad22-Nov-05 10:35
professionalPaul Conrad22-Nov-05 10:35 
AnswerRe: SQL 2005 Express? Pin
Paul Conrad23-Nov-05 7:43
professionalPaul Conrad23-Nov-05 7:43 
QuestionAutoIncrement Pin
vuthaianh21-Nov-05 20:58
vuthaianh21-Nov-05 20:58 
AnswerRe: AutoIncrement Pin
S Douglas22-Nov-05 0:36
professionalS Douglas22-Nov-05 0:36 
QuestionHow to write the Query Pin
Medikonda21-Nov-05 20:19
Medikonda21-Nov-05 20:19 
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 

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.