Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. SqlCommand

SqlCommand

Scheduled Pinned Locked Moved C#
databasequestion
20 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    akkram
    wrote on last edited by
    #1

    Hi. Is it possible to read data with the sqlcommand even though the database connection is closed? like: connection.Close(); int returnval = (int)Commandobj.Parameter[something].value;

    P P P 3 Replies Last reply
    0
    • A akkram

      Hi. Is it possible to read data with the sqlcommand even though the database connection is closed? like: connection.Close(); int returnval = (int)Commandobj.Parameter[something].value;

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      akkram wrote:

      Hi. Is it possible to read data with the sqlcommand even though the database connection is closed?

      Why don't you try it and find out? It's the best way to learn.

      Deja View - the feeling that you've seen this post before.

      1 Reply Last reply
      0
      • A akkram

        Hi. Is it possible to read data with the sqlcommand even though the database connection is closed? like: connection.Close(); int returnval = (int)Commandobj.Parameter[something].value;

        P Offline
        P Offline
        pmarfleet
        wrote on last edited by
        #3

        Have you tried it? Paul

        A 1 Reply Last reply
        0
        • P pmarfleet

          Have you tried it? Paul

          A Offline
          A Offline
          akkram
          wrote on last edited by
          #4

          I would if i could, but at the moment im at work and have no way of testing it.

          P G 2 Replies Last reply
          0
          • A akkram

            I would if i could, but at the moment im at work and have no way of testing it.

            P Offline
            P Offline
            pmarfleet
            wrote on last edited by
            #5

            When you get time, I suggest you try it out for yourself. Paul

            P A 2 Replies Last reply
            0
            • P pmarfleet

              When you get time, I suggest you try it out for yourself. Paul

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              5ed for keeping your cool.:cool:

              Deja View - the feeling that you've seen this post before.

              1 Reply Last reply
              0
              • A akkram

                I would if i could, but at the moment im at work and have no way of testing it.

                G Offline
                G Offline
                Giorgi Dalakishvili
                wrote on last edited by
                #7

                akkram wrote:

                I would if i could, but at the moment im at work and have no way of testing it.

                Use Snippet Compiler[^]

                #region signature my articles #endregion

                A P 2 Replies Last reply
                0
                • P pmarfleet

                  When you get time, I suggest you try it out for yourself. Paul

                  A Offline
                  A Offline
                  akkram
                  wrote on last edited by
                  #8

                  Then I assume that you don't know the answer either and wonder why you even bothered to answer my post. In the mean time ill continue googling for the answer /Thx

                  C P P 3 Replies Last reply
                  0
                  • G Giorgi Dalakishvili

                    akkram wrote:

                    I would if i could, but at the moment im at work and have no way of testing it.

                    Use Snippet Compiler[^]

                    #region signature my articles #endregion

                    A Offline
                    A Offline
                    akkram
                    wrote on last edited by
                    #9

                    works on mac ill assume?

                    P 1 Reply Last reply
                    0
                    • G Giorgi Dalakishvili

                      akkram wrote:

                      I would if i could, but at the moment im at work and have no way of testing it.

                      Use Snippet Compiler[^]

                      #region signature my articles #endregion

                      P Offline
                      P Offline
                      Pete OHanlon
                      wrote on last edited by
                      #10

                      Nice. This is a new one for me.

                      Deja View - the feeling that you've seen this post before.

                      A 1 Reply Last reply
                      0
                      • A akkram

                        Then I assume that you don't know the answer either and wonder why you even bothered to answer my post. In the mean time ill continue googling for the answer /Thx

                        C Offline
                        C Offline
                        Colin Angus Mackay
                        wrote on last edited by
                        #11

                        akkram wrote:

                        Then I assume that you don't know the answer either and wonder why you even bothered to answer my post.

                        No necessarily true: Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime. What the others were trying to to was to teach you that small problems like this are easily testable in a small application. You can then work out the answer from there much faster than posting on a forum and awaiting a response.

                        akkram wrote:

                        In the mean time ill continue googling for the answer

                        And if you try it for yourself you'll have the answer. If you don't have access to visual studio right now then I don't see what advantage you have in knowing the answer right now.


                        Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website

                        A 1 Reply Last reply
                        0
                        • A akkram

                          Then I assume that you don't know the answer either and wonder why you even bothered to answer my post. In the mean time ill continue googling for the answer /Thx

                          P Offline
                          P Offline
                          Pete OHanlon
                          wrote on last edited by
                          #12

                          akkram wrote:

                          Then I assume that you don't know the answer either and wonder why you even bothered to answer my post.

                          That doesn't necessarily follow. If you spend sometime round the boards, you will find that people often post questions before they have tried to find the answer for themselves. Something like this is so simple to prove that it is reasonable to assume that you will have to try it for yourself. The forums aren't here for us to do your work for you, or to do your thinking either. The advice to try it for yourself is good advice. It gets you into the habit of trying things and only coming back once you've run out of things to try or got stuck.

                          Deja View - the feeling that you've seen this post before.

                          1 Reply Last reply
                          0
                          • C Colin Angus Mackay

                            akkram wrote:

                            Then I assume that you don't know the answer either and wonder why you even bothered to answer my post.

                            No necessarily true: Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime. What the others were trying to to was to teach you that small problems like this are easily testable in a small application. You can then work out the answer from there much faster than posting on a forum and awaiting a response.

                            akkram wrote:

                            In the mean time ill continue googling for the answer

                            And if you try it for yourself you'll have the answer. If you don't have access to visual studio right now then I don't see what advantage you have in knowing the answer right now.


                            Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website

                            A Offline
                            A Offline
                            akkram
                            wrote on last edited by
                            #13

                            Colin Angus Mackay wrote:

                            And if you try it for yourself you'll have the answer. If you don't have access to visual studio right now then I don't see what advantage you have in knowing the answer right now.

                            So what you are saying is that there is never an advantage/use to know anything about anything unless when you need to apply that knowledge in practice?

                            C D 2 Replies Last reply
                            0
                            • A akkram

                              Colin Angus Mackay wrote:

                              And if you try it for yourself you'll have the answer. If you don't have access to visual studio right now then I don't see what advantage you have in knowing the answer right now.

                              So what you are saying is that there is never an advantage/use to know anything about anything unless when you need to apply that knowledge in practice?

                              C Offline
                              C Offline
                              Colin Angus Mackay
                              wrote on last edited by
                              #14

                              akkram wrote:

                              So what you are saying is that there is never an advantage/use to know anything about anything unless when you need to apply that knowledge in practice?

                              No, I'm saying that the urgency in which you seem to be attempting to gain this current piece of information isn't immediately necessary.


                              Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website

                              1 Reply Last reply
                              0
                              • A akkram

                                Then I assume that you don't know the answer either and wonder why you even bothered to answer my post. In the mean time ill continue googling for the answer /Thx

                                P Offline
                                P Offline
                                pmarfleet
                                wrote on last edited by
                                #15

                                If, as you admit, you haven't tried to find the answer out for yourself, I'm not sure why you should expect others to give up their time to solve the problem for you. Paul

                                1 Reply Last reply
                                0
                                • P Pete OHanlon

                                  Nice. This is a new one for me.

                                  Deja View - the feeling that you've seen this post before.

                                  A Offline
                                  A Offline
                                  althamda
                                  wrote on last edited by
                                  #16

                                  You can't really blame this guy for not wanting to try anything out for himself, it's an extremely easy route to try in life. I blame it on the parents.

                                  P 1 Reply Last reply
                                  0
                                  • A althamda

                                    You can't really blame this guy for not wanting to try anything out for himself, it's an extremely easy route to try in life. I blame it on the parents.

                                    P Offline
                                    P Offline
                                    Pete OHanlon
                                    wrote on last edited by
                                    #17

                                    althamda wrote:

                                    I blame it on the parents.

                                    You think they should have exercised some self-restraint?

                                    Deja View - the feeling that you've seen this post before.

                                    1 Reply Last reply
                                    0
                                    • A akkram

                                      works on mac ill assume?

                                      P Offline
                                      P Offline
                                      PIEBALDconsult
                                      wrote on last edited by
                                      #18

                                      Oh, Mac, there's your problem.

                                      1 Reply Last reply
                                      0
                                      • A akkram

                                        Colin Angus Mackay wrote:

                                        And if you try it for yourself you'll have the answer. If you don't have access to visual studio right now then I don't see what advantage you have in knowing the answer right now.

                                        So what you are saying is that there is never an advantage/use to know anything about anything unless when you need to apply that knowledge in practice?

                                        D Offline
                                        D Offline
                                        Dave Kreskowiak
                                        wrote on last edited by
                                        #19

                                        No, what they're all saying is that if you don't have the skillset to wip up a small test app and test whether this is possible or not and do the research yourself, your career as a developer is over before it even begins. Being able to do your own research, learn new technologies, testing your hypothesis, ..., are essential skills to surviving in the world of software development.

                                        A guide to posting questions on CodeProject[^]
                                        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                                             2006, 2007

                                        1 Reply Last reply
                                        0
                                        • A akkram

                                          Hi. Is it possible to read data with the sqlcommand even though the database connection is closed? like: connection.Close(); int returnval = (int)Commandobj.Parameter[something].value;

                                          P Offline
                                          P Offline
                                          PIEBALDconsult
                                          wrote on last edited by
                                          #20

                                          One of the greatest things about "software engineering" is that you can try out all sorts of strange things and no matter how bad the result is, you're unlikely to do any real damage to anything. Never be afraid to just try; we learn more from our mistakes than from getting it right the first time.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups