Click here to Skip to main content
15,892,927 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: help me. Pin
Henry Minute10-Sep-09 2:32
Henry Minute10-Sep-09 2:32 
GeneralRe: help me. Pin
Richard MacCutchan10-Sep-09 7:32
mveRichard MacCutchan10-Sep-09 7:32 
AnswerRe: help me. Pin
Dave Kreskowiak10-Sep-09 4:45
mveDave Kreskowiak10-Sep-09 4:45 
AnswerRe: help me. Pin
Not Active10-Sep-09 8:30
mentorNot Active10-Sep-09 8:30 
QuestionClickOnce/MageUI Deployment Error - Using MageUI to add other assemblies to the install. Pin
Jake Slack9-Sep-09 10:23
Jake Slack9-Sep-09 10:23 
Questionproblem with ling Pin
Ebube9-Sep-09 5:43
Ebube9-Sep-09 5:43 
Questionproblem with ling Pin
Ebube9-Sep-09 5:43
Ebube9-Sep-09 5:43 
QuestionUnderstanding using statement Pin
Vipul Mehta9-Sep-09 0:56
Vipul Mehta9-Sep-09 0:56 
Hi,

I just wanted some clarification for using statement. With reference to my below code, lets say for some reason there is any exception on the following line of code - command.Parameters.Add("@ID", SqlDbType.Int)
So in case of exception, the lines of code after the above line of code will not get executed and the control will move on to the last line of the method. Considering this scenario, I wanted to know will the connection and command objects (which are already initialised) get disposed?

using (DbConnection connection = 
            this.Database.ConnectionManager.GetConnection())
    {
        using (DbCommand command = connection.CreateCommand())
        {
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "spGetList";
            
            command.Parameters.Add("@ID", SqlDbType.Int)
            command.Parameters("@ID").Value = this.ID
            
            using(DbDataReader dataReader = 
                    this.Database.Execute<DbDataReader>(command,
                    DatabaseExecutionType.DataReader))
            {
                this.Fill(dataReader);
            }
        }
    }


Regards,
Vipul Mehta

AnswerRe: Understanding using statement Pin
Eddy Vluggen9-Sep-09 1:24
professionalEddy Vluggen9-Sep-09 1:24 
AnswerRe: Understanding using statement Pin
Jaime Olivares9-Sep-09 3:13
Jaime Olivares9-Sep-09 3:13 
AnswerRe: Understanding using statement Pin
DaveyM699-Sep-09 3:49
professionalDaveyM699-Sep-09 3:49 
AnswerRe: Understanding using statement Pin
supercat911-Sep-09 8:02
supercat911-Sep-09 8:02 
AnswerRe: Understanding using statement Pin
muktaa15-Sep-09 1:12
muktaa15-Sep-09 1:12 
AnswerRe: Understanding using statement Pin
Shameel22-Oct-09 5:37
professionalShameel22-Oct-09 5:37 
QuestionConfigurationManager: ConfigurationErrorsException after removing config attribute? [RESOLVED] Pin
Homncruse8-Sep-09 13:17
Homncruse8-Sep-09 13:17 
AnswerRe: ConfigurationManager: ConfigurationErrorsException after removing config attribute? Pin
Shameel22-Oct-09 5:41
professionalShameel22-Oct-09 5:41 
GeneralRe: ConfigurationManager: ConfigurationErrorsException after removing config attribute? Pin
Homncruse22-Oct-09 6:36
Homncruse22-Oct-09 6:36 
GeneralRe: ConfigurationManager: ConfigurationErrorsException after removing config attribute? Pin
Shameel22-Oct-09 8:56
professionalShameel22-Oct-09 8:56 
GeneralRe: ConfigurationManager: ConfigurationErrorsException after removing config attribute? Pin
Homncruse22-Oct-09 9:34
Homncruse22-Oct-09 9:34 
GeneralRe: ConfigurationManager: ConfigurationErrorsException after removing config attribute? Pin
Shameel23-Oct-09 8:23
professionalShameel23-Oct-09 8:23 
GeneralRe: ConfigurationManager: ConfigurationErrorsException after removing config attribute? Pin
Shameel23-Oct-09 8:25
professionalShameel23-Oct-09 8:25 
GeneralRe: ConfigurationManager: ConfigurationErrorsException after removing config attribute? Pin
Homncruse23-Oct-09 8:41
Homncruse23-Oct-09 8:41 
QuestionPartial loading of .net assemblies Pin
Jaime Olivares7-Sep-09 20:53
Jaime Olivares7-Sep-09 20:53 
AnswerRe: Partial loading of .net assemblies [modified] Pin
Eddy Vluggen7-Sep-09 21:12
professionalEddy Vluggen7-Sep-09 21:12 
GeneralRe: Partial loading of .net assemblies Pin
Jaime Olivares7-Sep-09 21:21
Jaime Olivares7-Sep-09 21:21 

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.