Click here to Skip to main content
15,903,012 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionProblem showing an existing form called from another existing form Pin
regnwald6-Feb-09 15:42
regnwald6-Feb-09 15:42 
AnswerRe: Problem showing an existing form called from another existing form Pin
N a v a n e e t h6-Feb-09 15:55
N a v a n e e t h6-Feb-09 15:55 
GeneralRe: Problem showing an existing form called from another existing form Pin
regnwald6-Feb-09 17:08
regnwald6-Feb-09 17:08 
GeneralRe: Problem showing an existing form called from another existing form Pin
N a v a n e e t h7-Feb-09 2:30
N a v a n e e t h7-Feb-09 2:30 
GeneralRe: Problem showing an existing form called from another existing form Pin
regnwald7-Feb-09 13:17
regnwald7-Feb-09 13:17 
Questiononline tic tac toe Pin
staticv6-Feb-09 4:30
staticv6-Feb-09 4:30 
AnswerRe: online tic tac toe Pin
«_Superman_»6-Feb-09 16:45
professional«_Superman_»6-Feb-09 16:45 
Questionconnecting to mysql in a remote location.. Pin
Thilek5-Feb-09 5:33
Thilek5-Feb-09 5:33 
hi guys,

i been writing a program that connect to a remote database in speedhosting.co.cc .But i been having problem to connect its showing error when i run it...

Error message :

An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll

Additional information: Unable to connect to any of the specified MySQL hosts.


below is my coding :-

#pragma once


namespace trialcpp {

	using namespace System;
	using namespace System::ComponentModel;
	
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;
	using namespace MySql::Data::MySqlClient;


	/// <summary>
	/// Summary for Form1
	///
	/// WARNING: If you change the name of this class, you will need to change the
	///          'Resource File Name' property for the managed resource compiler tool
	///          associated with all .resx files this class depends on.  Otherwise,
	///          the designers will not be able to interact properly with localized
	///          resources associated with this form.
	/// </summary>

	
	public ref class Form1 : public System::Windows::Forms::Form
	{
	public:
		Form1(void)
		{
			InitializeComponent();
			//
			//TODO: Add the constructor code here
			//
		}
		

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~Form1()
		{
			if (components)
			{
				delete components;
			}
		}

	
	private: System::Windows::Forms::Button^  cmdLogin;
	private: System::Windows::Forms::Button^  cmdExit;

	protected: 

	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
		System::ComponentModel::Container ^components;

	
	
#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			this->cmdLogin = (gcnew System::Windows::Forms::Button());
			this->cmdExit = (gcnew System::Windows::Forms::Button());
			this->SuspendLayout();
			// 
			// cmdLogin
			// 
			this->cmdLogin->Location = System::Drawing::Point(52, 190);
			this->cmdLogin->Name = L"cmdLogin";
			this->cmdLogin->Size = System::Drawing::Size(75, 23);
			this->cmdLogin->TabIndex = 0;
			this->cmdLogin->Text = L"Login";
			this->cmdLogin->UseVisualStyleBackColor = true;
			this->cmdLogin->Click += gcnew System::EventHandler(this, &Form1::cmdLogin_Click);
			// 
			// cmdExit
			// 
			this->cmdExit->Location = System::Drawing::Point(175, 190);
			this->cmdExit->Name = L"cmdExit";
			this->cmdExit->Size = System::Drawing::Size(75, 23);
			this->cmdExit->TabIndex = 1;
			this->cmdExit->Text = L"Exit";
			this->cmdExit->UseVisualStyleBackColor = true;
			this->cmdExit->Click += gcnew System::EventHandler(this, &Form1::Exit_Click);
			// 
			// Form1
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(326, 266);
			this->Controls->Add(this->cmdExit);
			this->Controls->Add(this->cmdLogin);
			this->Name = L"Form1";
			this->Text = L"Form1";
			this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
			this->ResumeLayout(false);

		}
#pragma endregion

	

	private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
				
			 }
	private: System::Void Exit_Click(System::Object^  sender, System::EventArgs^  e) {

				this->Close();

			 }
	  

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

				
				 MySqlConnection ^conDatabase = gcnew MySqlConnection("DataSource = 'http://sql304.xxxx.xxx; User Name='username'; Password='password'; database='database name'");
	

	 conDatabase->Open();



	System::Windows::Forms::MessageBox::Show("Connection Successful");
	
	  conDatabase->Close();


				 
			 }
	};






Kindly help me guys plz.. thanks a lot.

Regards,

Thilek
AnswerRe: connecting to mysql in a remote location.. Pin
led mike5-Feb-09 6:37
led mike5-Feb-09 6:37 
AnswerRe: connecting to mysql in a remote location.. Pin
N a v a n e e t h5-Feb-09 15:26
N a v a n e e t h5-Feb-09 15:26 
GeneralRe: connecting to mysql in a remote location.. Pin
Thilek5-Feb-09 23:16
Thilek5-Feb-09 23:16 
GeneralRe: connecting to mysql in a remote location.. Pin
N a v a n e e t h6-Feb-09 14:37
N a v a n e e t h6-Feb-09 14:37 
GeneralRe: connecting to mysql in a remote location.. Pin
Thilek6-Feb-09 18:53
Thilek6-Feb-09 18:53 
GeneralRe: connecting to mysql in a remote location.. Pin
N a v a n e e t h7-Feb-09 2:42
N a v a n e e t h7-Feb-09 2:42 
GeneralRe: connecting to mysql in a remote location.. Pin
Thilek9-Feb-09 5:11
Thilek9-Feb-09 5:11 
Questionvector<wstring> to System::String ??</wstring> Pin
Thilek4-Feb-09 19:52
Thilek4-Feb-09 19:52 
AnswerRe: vector to System::String ?? Pin
N a v a n e e t h4-Feb-09 20:01
N a v a n e e t h4-Feb-09 20:01 
GeneralRe: vector to System::String ?? Pin
Thilek5-Feb-09 1:28
Thilek5-Feb-09 1:28 
GeneralRe: vector to System::String ?? Pin
N a v a n e e t h5-Feb-09 17:05
N a v a n e e t h5-Feb-09 17:05 
Questionbuttons exception Pin
staticv3-Feb-09 5:30
staticv3-Feb-09 5:30 
GeneralRe: buttons exception Pin
Luc Pattyn3-Feb-09 6:24
sitebuilderLuc Pattyn3-Feb-09 6:24 
GeneralRe: buttons exception Pin
staticv3-Feb-09 7:02
staticv3-Feb-09 7:02 
GeneralRe: buttons exception Pin
Luc Pattyn3-Feb-09 7:05
sitebuilderLuc Pattyn3-Feb-09 7:05 
QuestionHi all Pin
tasumisra2-Feb-09 22:38
tasumisra2-Feb-09 22:38 
AnswerRe: Hi all Pin
Mark Salsbery3-Feb-09 5:01
Mark Salsbery3-Feb-09 5:01 

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.