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. The Lounge
  3. Please explain this code i m using Vb 2010

Please explain this code i m using Vb 2010

Scheduled Pinned Locked Moved The Lounge
databasesysadmin
11 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {

    			MySqlConnection^ con =gcnew MySqlConnection("server=localhost;port=3306;userid=root;password=themohal123;database=myfirstdb");
    		try
    		 {
    			 con->Open();
    			 MessageBox::Show("Connection Successful");
    			 con->Close();
    			 
    			 
    		}
    		catch (Exception^ ex)
    		{
    		 MessageBox::Show("Connection Not Successful"+ ex);
    		}
    		 
    		 
    		 }
    
    M S P P realJSOPR 6 Replies Last reply
    0
    • L Lost User

      private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {

      			MySqlConnection^ con =gcnew MySqlConnection("server=localhost;port=3306;userid=root;password=themohal123;database=myfirstdb");
      		try
      		 {
      			 con->Open();
      			 MessageBox::Show("Connection Successful");
      			 con->Close();
      			 
      			 
      		}
      		catch (Exception^ ex)
      		{
      		 MessageBox::Show("Connection Not Successful"+ ex);
      		}
      		 
      		 
      		 }
      
      M Offline
      M Offline
      Mark_Wallace
      wrote on last edited by
      #2

      It informs Microsoft whether or not it has established control of your personal information. If it hasn't, it moves on to try nastier methods.

      I wanna be a eunuchs developer! Pass me a bread knife!

      1 Reply Last reply
      0
      • L Lost User

        private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {

        			MySqlConnection^ con =gcnew MySqlConnection("server=localhost;port=3306;userid=root;password=themohal123;database=myfirstdb");
        		try
        		 {
        			 con->Open();
        			 MessageBox::Show("Connection Successful");
        			 con->Close();
        			 
        			 
        		}
        		catch (Exception^ ex)
        		{
        		 MessageBox::Show("Connection Not Successful"+ ex);
        		}
        		 
        		 
        		 }
        
        S Offline
        S Offline
        Sascha Lefevre
        wrote on last edited by
        #3

        You posted your question in the wrong forum. See that hint in the forum header?: "Technical discussions are encouraged, but click here to ask your programming question." The code basically only attempts to establish a connection to the MySQL-server using the address and credentials in the connection string and shows a MessageBox telling you whether it succeeded or not. Next time, please click the big green button "Ask a Question" on the homepage, it will lead you to the correct place to post a programming question.

        If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

        L 1 Reply Last reply
        0
        • L Lost User

          private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {

          			MySqlConnection^ con =gcnew MySqlConnection("server=localhost;port=3306;userid=root;password=themohal123;database=myfirstdb");
          		try
          		 {
          			 con->Open();
          			 MessageBox::Show("Connection Successful");
          			 con->Close();
          			 
          			 
          		}
          		catch (Exception^ ex)
          		{
          		 MessageBox::Show("Connection Not Successful"+ ex);
          		}
          		 
          		 
          		 }
          
          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          You aren't using VB. That's C++ syntax. If you think that's VB , you need to pay more attention in class.

          This space for rent

          L S 2 Replies Last reply
          0
          • S Sascha Lefevre

            You posted your question in the wrong forum. See that hint in the forum header?: "Technical discussions are encouraged, but click here to ask your programming question." The code basically only attempts to establish a connection to the MySQL-server using the address and credentials in the connection string and shows a MessageBox telling you whether it succeeded or not. Next time, please click the big green button "Ask a Question" on the homepage, it will lead you to the correct place to post a programming question.

            If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            i m starter ..thanks for the appreciative replies .. ;P

            1 Reply Last reply
            0
            • P Pete OHanlon

              You aren't using VB. That's C++ syntax. If you think that's VB , you need to pay more attention in class.

              This space for rent

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              thanks @Pete-OHanlon at least u figure out my problem .. ;)

              1 Reply Last reply
              0
              • P Pete OHanlon

                You aren't using VB. That's C++ syntax. If you think that's VB , you need to pay more attention in class.

                This space for rent

                S Offline
                S Offline
                Slacker007
                wrote on last edited by
                #7

                Now, that was funny. :)

                1 Reply Last reply
                0
                • L Lost User

                  private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {

                  			MySqlConnection^ con =gcnew MySqlConnection("server=localhost;port=3306;userid=root;password=themohal123;database=myfirstdb");
                  		try
                  		 {
                  			 con->Open();
                  			 MessageBox::Show("Connection Successful");
                  			 con->Close();
                  			 
                  			 
                  		}
                  		catch (Exception^ ex)
                  		{
                  		 MessageBox::Show("Connection Not Successful"+ ex);
                  		}
                  		 
                  		 
                  		 }
                  
                  P Offline
                  P Offline
                  Pete Zahir
                  wrote on last edited by
                  #8

                  It is example of harde coded strings and logins in SQL code. In other words very realistic code.

                  1 Reply Last reply
                  0
                  • L Lost User

                    private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {

                    			MySqlConnection^ con =gcnew MySqlConnection("server=localhost;port=3306;userid=root;password=themohal123;database=myfirstdb");
                    		try
                    		 {
                    			 con->Open();
                    			 MessageBox::Show("Connection Successful");
                    			 con->Close();
                    			 
                    			 
                    		}
                    		catch (Exception^ ex)
                    		{
                    		 MessageBox::Show("Connection Not Successful"+ ex);
                    		}
                    		 
                    		 
                    		 }
                    
                    realJSOPR Offline
                    realJSOPR Offline
                    realJSOP
                    wrote on last edited by
                    #9

                    The fact that you think that's VB indicates that you're a freakin' retard.

                    ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                    -----
                    You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                    -----
                    When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                    E 1 Reply Last reply
                    0
                    • realJSOPR realJSOP

                      The fact that you think that's VB indicates that you're a freakin' retard.

                      ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                      -----
                      You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                      -----
                      When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                      E Offline
                      E Offline
                      Eytukan
                      wrote on last edited by
                      #10

                      John Simmons / outlaw programmer wrote:

                      The fact that you think that's VB indicates that you're a freakin' retard.

                      The fact that you think a fresher, 'a retard' just because he mistook a piece of snippet indicates you are a.. genius. :P Okay take it easy. I haven't said anything wrong. :rolleyes: On the point: People usually dont get to see managed C++, in particular the UI application code often. Since it's looking quite an event driven, Sql connecting, messagebox showing, and not looking like C# one, the innocent learner thought it's VB.

                      Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy.

                      1 Reply Last reply
                      0
                      • L Lost User

                        private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {

                        			MySqlConnection^ con =gcnew MySqlConnection("server=localhost;port=3306;userid=root;password=themohal123;database=myfirstdb");
                        		try
                        		 {
                        			 con->Open();
                        			 MessageBox::Show("Connection Successful");
                        			 con->Close();
                        			 
                        			 
                        		}
                        		catch (Exception^ ex)
                        		{
                        		 MessageBox::Show("Connection Not Successful"+ ex);
                        		}
                        		 
                        		 
                        		 }
                        
                        E Offline
                        E Offline
                        Eytukan
                        wrote on last edited by
                        #11

                        Freshers can be dumb enough to mistake language syntaxes, but shouldnt be up to the level of posting connection strings in public. You are just few steps away to get your machine hacked for free. ;)

                        Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy.

                        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