Please explain this code i m using Vb 2010
-
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); } }
-
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); } }
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!
-
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); } }
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
-
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
-
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); } }
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
-
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
thanks @Pete-OHanlon at least u figure out my problem .. ;)
-
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
Now, that was funny. :)
-
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); } }
It is example of harde coded strings and logins in SQL code. In other words very realistic code.
-
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); } }
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 -
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, 2013John 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.
-
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); } }
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.