Click here to Skip to main content
15,898,134 members
Home / Discussions / Database
   

Database

 
AnswerRe: SQl Query Problem Pin
pradeep.shukla1-Apr-07 20:34
pradeep.shukla1-Apr-07 20:34 
GeneralRe: SQl Query Problem Pin
Devkranth Kishore Vanja1-Apr-07 20:43
Devkranth Kishore Vanja1-Apr-07 20:43 
QuestionHow to use report generated by sql server 2005 reporting service in web application Pin
mohd imran abdul aziz1-Apr-07 18:19
mohd imran abdul aziz1-Apr-07 18:19 
QuestionPlz answer these Pin
yaminilatha1-Apr-07 17:54
yaminilatha1-Apr-07 17:54 
AnswerRe: Plz answer these Pin
Krish - KP1-Apr-07 18:22
Krish - KP1-Apr-07 18:22 
GeneralRe: Plz answer these Pin
yaminilatha1-Apr-07 23:45
yaminilatha1-Apr-07 23:45 
GeneralRe: Plz answer these Pin
Krish - KP2-Apr-07 0:11
Krish - KP2-Apr-07 0:11 
AnswerRe: Plz answer these Pin
Colin Angus Mackay1-Apr-07 22:02
Colin Angus Mackay1-Apr-07 22:02 
Regarding #2

Although you don't have to call Close() it is advisable. While the DataReader is open you are tying up the connection so it cannot be used until the reader has been collected by the garbage collector. You don't have any control over when the garbage collector will collect the reader.

Another option is to wrap it in a using statment and have C# close it when it drops out of scope

using(SqlDataReader dr = cmd.ExecuteReader())
{
    while(dr.Read())
    {
        // Do stuff.
    }
}



AnswerRe: Plz answer these Pin
Pete O'Hanlon2-Apr-07 1:41
mvePete O'Hanlon2-Apr-07 1:41 
QuestionInserting documents into SQL server 2000 Pin
missrej1-Apr-07 6:21
missrej1-Apr-07 6:21 
AnswerRe: Inserting documents into SQL server 2000 Pin
Hesham Amin1-Apr-07 6:30
Hesham Amin1-Apr-07 6:30 
QuestionINSERT Query Pin
nadinekamal1-Apr-07 4:47
nadinekamal1-Apr-07 4:47 
AnswerRe: INSERT Query Pin
Bernard Aoun1-Apr-07 5:57
Bernard Aoun1-Apr-07 5:57 
QuestionSelect Query Pin
Girish48131-Mar-07 18:57
Girish48131-Mar-07 18:57 
AnswerRe: Select Query Pin
jijoaresseriljose31-Mar-07 23:15
jijoaresseriljose31-Mar-07 23:15 
AnswerRe: Select Query Pin
Girish4811-Apr-07 3:34
Girish4811-Apr-07 3:34 
AnswerRe: Select Query Pin
Krish - KP6-Apr-07 4:42
Krish - KP6-Apr-07 4:42 
QuestionBest practice in large tables Pin
Nader Elshehabi31-Mar-07 10:10
Nader Elshehabi31-Mar-07 10:10 
AnswerRe: Best practice in large tables Pin
Colin Angus Mackay31-Mar-07 10:23
Colin Angus Mackay31-Mar-07 10:23 
GeneralRe: Best practice in large tables Pin
Nader Elshehabi31-Mar-07 10:36
Nader Elshehabi31-Mar-07 10:36 
AnswerRe: Best practice in large tables Pin
kubben31-Mar-07 14:41
kubben31-Mar-07 14:41 
GeneralRe: Best practice in large tables Pin
Nader Elshehabi31-Mar-07 21:58
Nader Elshehabi31-Mar-07 21:58 
QuestionSQL Stored Procedure Column Pin
Lea Hayes31-Mar-07 9:24
Lea Hayes31-Mar-07 9:24 
AnswerRe: SQL Stored Procedure Column Pin
Colin Angus Mackay31-Mar-07 10:09
Colin Angus Mackay31-Mar-07 10:09 
GeneralRe: SQL Stored Procedure Column Pin
Lea Hayes31-Mar-07 10:17
Lea Hayes31-Mar-07 10:17 

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.