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. Web Development
  3. ASP.NET
  4. Please help with these questions

Please help with these questions

Scheduled Pinned Locked Moved ASP.NET
questiondatabasedebugginghelp
5 Posts 5 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
    A Asif
    wrote on last edited by
    #1

    Hello- Please help me with the following questions, if possible, please also provide some explanations--thanks in advance: 1) Assuming that "valid connection string" is a valid connection string, what will be the output of the following code? If the code cannot compile, please state why. the same rules apply to this question as for the one above using(SqlConnection sqlConn = new SqlConnection("valid Connection string")) { System.Diagnostics.Debug.WriteLine("Opening a connection"); sqlConn.Open(); System.Diagnostics.Debug.WriteLine("Connection Opened"); sqlConn.Close(); System.Diagnostics.Debug.WriteLine("Connection Closed"); } if(sqlConn == null) System.Diagnostics.Debug.WriteLine("Connection State is NULL"); else System.Diagnostics.Debug.WriteLine("Connection State:" + sqlConn.ConnectionState); 2)The following code needs to generate a string of 1000 alternating '+' and '-' characters Rewrite this code to make it more efficient (Note: You can use different data types than the ones present) string htmlOutput = string.Empty; for(int itemIndex = 0; itemIndex < 1000; itemIndex++) { if( itemIndex % 2 == 0) htmlOutput += "+"; else htmlOutput += "-"; } 3)Assuming that CustomException is defined, what will be the output of the following code? try { throw new CustomException("Something went wrong"); } catch(Exception ex) { System.Diagnostics.Debug.WriteLine("Generic Exception has been triggered"); } catch(CustomException ex) { System.Diagnostics.Debug.WriteLine("Custom Exception has been triggered"); } 4) What will be the difference in behavior between the lines marked 'a' and 'b' during runtime? (Assume that CustomClass is a defined class) object objClass = new object(); CustomClass myClass1 = objClass as CustomClass; //a CustomClass myClass2 = (CustomClass)objClass; //b 5) Assuming you have the following class: public class MyClass { public MyClass() { } public string DoNothing(string someParameter) { System.Diagnostics.Debug.WriteLine(someParameter); } } How would you call the DoNothing function asynchronously and provide a callback? 6) What is the difference between a Monitor and a Semaphore? 7) Architectural Question: If you have pages that perform heavy DB or File I/O, what could be

    N C G V 4 Replies Last reply
    0
    • A A Asif

      Hello- Please help me with the following questions, if possible, please also provide some explanations--thanks in advance: 1) Assuming that "valid connection string" is a valid connection string, what will be the output of the following code? If the code cannot compile, please state why. the same rules apply to this question as for the one above using(SqlConnection sqlConn = new SqlConnection("valid Connection string")) { System.Diagnostics.Debug.WriteLine("Opening a connection"); sqlConn.Open(); System.Diagnostics.Debug.WriteLine("Connection Opened"); sqlConn.Close(); System.Diagnostics.Debug.WriteLine("Connection Closed"); } if(sqlConn == null) System.Diagnostics.Debug.WriteLine("Connection State is NULL"); else System.Diagnostics.Debug.WriteLine("Connection State:" + sqlConn.ConnectionState); 2)The following code needs to generate a string of 1000 alternating '+' and '-' characters Rewrite this code to make it more efficient (Note: You can use different data types than the ones present) string htmlOutput = string.Empty; for(int itemIndex = 0; itemIndex < 1000; itemIndex++) { if( itemIndex % 2 == 0) htmlOutput += "+"; else htmlOutput += "-"; } 3)Assuming that CustomException is defined, what will be the output of the following code? try { throw new CustomException("Something went wrong"); } catch(Exception ex) { System.Diagnostics.Debug.WriteLine("Generic Exception has been triggered"); } catch(CustomException ex) { System.Diagnostics.Debug.WriteLine("Custom Exception has been triggered"); } 4) What will be the difference in behavior between the lines marked 'a' and 'b' during runtime? (Assume that CustomClass is a defined class) object objClass = new object(); CustomClass myClass1 = objClass as CustomClass; //a CustomClass myClass2 = (CustomClass)objClass; //b 5) Assuming you have the following class: public class MyClass { public MyClass() { } public string DoNothing(string someParameter) { System.Diagnostics.Debug.WriteLine(someParameter); } } How would you call the DoNothing function asynchronously and provide a callback? 6) What is the difference between a Monitor and a Semaphore? 7) Architectural Question: If you have pages that perform heavy DB or File I/O, what could be

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Job search questions or class assignment?


      only two letters away from being an asset

      1 Reply Last reply
      0
      • A A Asif

        Hello- Please help me with the following questions, if possible, please also provide some explanations--thanks in advance: 1) Assuming that "valid connection string" is a valid connection string, what will be the output of the following code? If the code cannot compile, please state why. the same rules apply to this question as for the one above using(SqlConnection sqlConn = new SqlConnection("valid Connection string")) { System.Diagnostics.Debug.WriteLine("Opening a connection"); sqlConn.Open(); System.Diagnostics.Debug.WriteLine("Connection Opened"); sqlConn.Close(); System.Diagnostics.Debug.WriteLine("Connection Closed"); } if(sqlConn == null) System.Diagnostics.Debug.WriteLine("Connection State is NULL"); else System.Diagnostics.Debug.WriteLine("Connection State:" + sqlConn.ConnectionState); 2)The following code needs to generate a string of 1000 alternating '+' and '-' characters Rewrite this code to make it more efficient (Note: You can use different data types than the ones present) string htmlOutput = string.Empty; for(int itemIndex = 0; itemIndex < 1000; itemIndex++) { if( itemIndex % 2 == 0) htmlOutput += "+"; else htmlOutput += "-"; } 3)Assuming that CustomException is defined, what will be the output of the following code? try { throw new CustomException("Something went wrong"); } catch(Exception ex) { System.Diagnostics.Debug.WriteLine("Generic Exception has been triggered"); } catch(CustomException ex) { System.Diagnostics.Debug.WriteLine("Custom Exception has been triggered"); } 4) What will be the difference in behavior between the lines marked 'a' and 'b' during runtime? (Assume that CustomClass is a defined class) object objClass = new object(); CustomClass myClass1 = objClass as CustomClass; //a CustomClass myClass2 = (CustomClass)objClass; //b 5) Assuming you have the following class: public class MyClass { public MyClass() { } public string DoNothing(string someParameter) { System.Diagnostics.Debug.WriteLine(someParameter); } } How would you call the DoNothing function asynchronously and provide a callback? 6) What is the difference between a Monitor and a Semaphore? 7) Architectural Question: If you have pages that perform heavy DB or File I/O, what could be

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        If someone answers these, how will that help you ? You'll get a job you don't deserver and will lose, or you'll move up a level in a course that you're currently incapable of doing, and you'll only be more stuck with the next assignment. Do your own homework, or look for a different career.

        Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        1 Reply Last reply
        0
        • A A Asif

          Hello- Please help me with the following questions, if possible, please also provide some explanations--thanks in advance: 1) Assuming that "valid connection string" is a valid connection string, what will be the output of the following code? If the code cannot compile, please state why. the same rules apply to this question as for the one above using(SqlConnection sqlConn = new SqlConnection("valid Connection string")) { System.Diagnostics.Debug.WriteLine("Opening a connection"); sqlConn.Open(); System.Diagnostics.Debug.WriteLine("Connection Opened"); sqlConn.Close(); System.Diagnostics.Debug.WriteLine("Connection Closed"); } if(sqlConn == null) System.Diagnostics.Debug.WriteLine("Connection State is NULL"); else System.Diagnostics.Debug.WriteLine("Connection State:" + sqlConn.ConnectionState); 2)The following code needs to generate a string of 1000 alternating '+' and '-' characters Rewrite this code to make it more efficient (Note: You can use different data types than the ones present) string htmlOutput = string.Empty; for(int itemIndex = 0; itemIndex < 1000; itemIndex++) { if( itemIndex % 2 == 0) htmlOutput += "+"; else htmlOutput += "-"; } 3)Assuming that CustomException is defined, what will be the output of the following code? try { throw new CustomException("Something went wrong"); } catch(Exception ex) { System.Diagnostics.Debug.WriteLine("Generic Exception has been triggered"); } catch(CustomException ex) { System.Diagnostics.Debug.WriteLine("Custom Exception has been triggered"); } 4) What will be the difference in behavior between the lines marked 'a' and 'b' during runtime? (Assume that CustomClass is a defined class) object objClass = new object(); CustomClass myClass1 = objClass as CustomClass; //a CustomClass myClass2 = (CustomClass)objClass; //b 5) Assuming you have the following class: public class MyClass { public MyClass() { } public string DoNothing(string someParameter) { System.Diagnostics.Debug.WriteLine(someParameter); } } How would you call the DoNothing function asynchronously and provide a callback? 6) What is the difference between a Monitor and a Semaphore? 7) Architectural Question: If you have pages that perform heavy DB or File I/O, what could be

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          What on earth posesses you to think that we should do your test for you?

          Despite everything, the person most likely to be fooling you next is yourself.

          1 Reply Last reply
          0
          • A A Asif

            Hello- Please help me with the following questions, if possible, please also provide some explanations--thanks in advance: 1) Assuming that "valid connection string" is a valid connection string, what will be the output of the following code? If the code cannot compile, please state why. the same rules apply to this question as for the one above using(SqlConnection sqlConn = new SqlConnection("valid Connection string")) { System.Diagnostics.Debug.WriteLine("Opening a connection"); sqlConn.Open(); System.Diagnostics.Debug.WriteLine("Connection Opened"); sqlConn.Close(); System.Diagnostics.Debug.WriteLine("Connection Closed"); } if(sqlConn == null) System.Diagnostics.Debug.WriteLine("Connection State is NULL"); else System.Diagnostics.Debug.WriteLine("Connection State:" + sqlConn.ConnectionState); 2)The following code needs to generate a string of 1000 alternating '+' and '-' characters Rewrite this code to make it more efficient (Note: You can use different data types than the ones present) string htmlOutput = string.Empty; for(int itemIndex = 0; itemIndex < 1000; itemIndex++) { if( itemIndex % 2 == 0) htmlOutput += "+"; else htmlOutput += "-"; } 3)Assuming that CustomException is defined, what will be the output of the following code? try { throw new CustomException("Something went wrong"); } catch(Exception ex) { System.Diagnostics.Debug.WriteLine("Generic Exception has been triggered"); } catch(CustomException ex) { System.Diagnostics.Debug.WriteLine("Custom Exception has been triggered"); } 4) What will be the difference in behavior between the lines marked 'a' and 'b' during runtime? (Assume that CustomClass is a defined class) object objClass = new object(); CustomClass myClass1 = objClass as CustomClass; //a CustomClass myClass2 = (CustomClass)objClass; //b 5) Assuming you have the following class: public class MyClass { public MyClass() { } public string DoNothing(string someParameter) { System.Diagnostics.Debug.WriteLine(someParameter); } } How would you call the DoNothing function asynchronously and provide a callback? 6) What is the difference between a Monitor and a Semaphore? 7) Architectural Question: If you have pages that perform heavy DB or File I/O, what could be

            V Offline
            V Offline
            Vasudevan Deepak Kumar
            wrote on last edited by
            #5

            The forum is intended for troubleshooting assistance and not to supplant regular homework. Read the forum guidelines here http://www.codeproject.com/kb/scrapbook/forumguidelines.aspx[^] Posting questions of this level of stupidity just makes you look like a rude jackass.

            Vasudevan Deepak Kumar Personal Homepage
            Tech Gossips
            A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

            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