Click here to Skip to main content
15,921,452 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: unable to concatenate strings in c++ Pin
Code-o-mat5-Feb-09 5:53
Code-o-mat5-Feb-09 5:53 
AnswerRe: unable to concatenate strings in c++ Pin
Stuart Dootson5-Feb-09 6:20
professionalStuart Dootson5-Feb-09 6:20 
GeneralRe: unable to concatenate strings in c++ Pin
Gregory Lund5-Feb-09 7:27
Gregory Lund5-Feb-09 7:27 
QuestionHow to read the contents of a VARIANT ? Pin
LindeA5-Feb-09 3:39
LindeA5-Feb-09 3:39 
AnswerRe: How to read the contents of a VARIANT ? Pin
CPallini5-Feb-09 3:55
mveCPallini5-Feb-09 3:55 
GeneralRe: How to read the contents of a VARIANT ? Pin
LindeA5-Feb-09 21:19
LindeA5-Feb-09 21:19 
AnswerRe: How to read the contents of a VARIANT ? Pin
prasad_som5-Feb-09 4:20
prasad_som5-Feb-09 4:20 
Questionconnecting to mysql server in remote location .. Pin
Thilek5-Feb-09 2:34
Thilek5-Feb-09 2:34 
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 = '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. Smile | :)

Regards,

Thilek
AnswerRe: connecting to mysql server in remote location .. Pin
Stuart Dootson5-Feb-09 4:02
professionalStuart Dootson5-Feb-09 4:02 
GeneralRe: connecting to mysql server in remote location .. Pin
Thilek5-Feb-09 5:30
Thilek5-Feb-09 5:30 
GeneralRe: connecting to mysql server in remote location .. Pin
Stuart Dootson5-Feb-09 6:13
professionalStuart Dootson5-Feb-09 6:13 
GeneralRe: connecting to mysql server in remote location .. Pin
Thilek5-Feb-09 23:18
Thilek5-Feb-09 23:18 
QuestionIShellFolder::SetNameOf() setting only virtual folders Pin
ab4rum5-Feb-09 2:26
ab4rum5-Feb-09 2:26 
AnswerRe: IShellFolder::SetNameOf() setting only virtual folders Pin
Stuart Dootson5-Feb-09 6:23
professionalStuart Dootson5-Feb-09 6:23 
GeneralRe: IShellFolder::SetNameOf() setting only virtual folders Pin
ab4rum7-Feb-09 0:28
ab4rum7-Feb-09 0:28 
QuestionNeed help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5025-Feb-09 2:13
John5025-Feb-09 2:13 
AnswerRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson5-Feb-09 3:03
professionalStuart Dootson5-Feb-09 3:03 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5025-Feb-09 20:04
John5025-Feb-09 20:04 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson5-Feb-09 21:34
professionalStuart Dootson5-Feb-09 21:34 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5026-Feb-09 5:13
John5026-Feb-09 5:13 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson6-Feb-09 5:50
professionalStuart Dootson6-Feb-09 5:50 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5026-Feb-09 6:24
John5026-Feb-09 6:24 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson6-Feb-09 7:16
professionalStuart Dootson6-Feb-09 7:16 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5026-Feb-09 7:35
John5026-Feb-09 7:35 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson6-Feb-09 8:03
professionalStuart Dootson6-Feb-09 8:03 

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.