Click here to Skip to main content
15,885,767 members
Home / Discussions / C#
   

C#

 
AnswerRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
Kornfeld Eliyahu Peter24-Jun-14 2:29
professionalKornfeld Eliyahu Peter24-Jun-14 2:29 
GeneralRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
Dave Kreskowiak24-Jun-14 1:39
mveDave Kreskowiak24-Jun-14 1:39 
SuggestionRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
Richard Deeming24-Jun-14 0:38
mveRichard Deeming24-Jun-14 0:38 
GeneralRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
OriginalGriff24-Jun-14 1:06
mveOriginalGriff24-Jun-14 1:06 
GeneralRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
Mycroft Holmes25-Jun-14 0:39
professionalMycroft Holmes25-Jun-14 0:39 
QuestionHow to convert a text file in unicode format to excel file Pin
botngot8323-Jun-14 20:54
botngot8323-Jun-14 20:54 
SuggestionRe: How to convert a text file in unicode format to excel file Pin
Nathan Minier24-Jun-14 3:12
professionalNathan Minier24-Jun-14 3:12 
QuestionConnect to MySQL using MySQL Connector.NET and SharpSsh Pin
Jassim Rahma23-Jun-14 20:24
Jassim Rahma23-Jun-14 20:24 
Connect to MySQL using MySQL Connector.NET and SharpSsh

Hi,

I am trying to connect to MySQL using the MySQL Connector.NET and SharpSsh but getting Unable to connect to MySQL although my SSH was successfully connected.

Can anyone help please...

Here is my code:

C#
private void btnExecSSH_Click(object sender, EventArgs e)
{
    SshExec exec = new SshExec("10.0.0.111", "root");
    exec.Password = "myPassword";

    exec.Connect(22);

    MessageBox.Show("SSH Connected");

    btnMySQL.PerformClick();
}

private void btnMySQL_Click(object sender, EventArgs e)
{
    try
    {
        sql_connection = new MySqlConnection("server = 10.0.0.111; Port = 3306; Database = bizcards; Uid = root; Pwd = myPassword;");
        sql_connection.Open();

        MessageBox.Show("Connected!", "Yahoo!", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
    catch (Exception exp)
    {
        MessageBox.Show(String.Format("Error:{0}{1}", Environment.NewLine, exp.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
}



Technology News @ www.JassimRahma.com

QuestionSetting A Global Hot Key On A Second Form Pin
rfresh23-Jun-14 18:55
rfresh23-Jun-14 18:55 
AnswerRe: Setting A Global Hot Key On A Second Form Pin
Eddy Vluggen24-Jun-14 0:34
professionalEddy Vluggen24-Jun-14 0:34 
GeneralRe: Setting A Global Hot Key On A Second Form Pin
rfresh24-Jun-14 3:21
rfresh24-Jun-14 3:21 
GeneralRe: Setting A Global Hot Key On A Second Form Pin
Eddy Vluggen24-Jun-14 5:09
professionalEddy Vluggen24-Jun-14 5:09 
QuestionPlacing UserControl within a UserControl (WPF) Pin
LAPEC23-Jun-14 8:57
LAPEC23-Jun-14 8:57 
AnswerRe: Placing UserControl within a UserControl (WPF) Pin
OriginalGriff23-Jun-14 20:01
mveOriginalGriff23-Jun-14 20:01 
QuestionMultiple application installer in single Setup file Pin
Ashfaque Hussain23-Jun-14 4:55
Ashfaque Hussain23-Jun-14 4:55 
AnswerRe: Multiple application installer in single Setup file Pin
Maciej Los23-Jun-14 9:40
mveMaciej Los23-Jun-14 9:40 
GeneralRe: Multiple application installer in single Setup file Pin
Ashfaque Hussain23-Jun-14 19:47
Ashfaque Hussain23-Jun-14 19:47 
GeneralRe: Multiple application installer in single Setup file Pin
Ashfaque Hussain23-Jun-14 23:37
Ashfaque Hussain23-Jun-14 23:37 
QuestionAbout Error - unable to find a version of the runtime to run this application." error when try to open the application. Pin
Member 1084900023-Jun-14 2:25
Member 1084900023-Jun-14 2:25 
AnswerRe: About Error - unable to find a version of the runtime to run this application." error when try to open the application. Pin
OriginalGriff23-Jun-14 2:38
mveOriginalGriff23-Jun-14 2:38 
QuestionC sharp windows application development Pin
Galacha Kevin23-Jun-14 2:09
Galacha Kevin23-Jun-14 2:09 
AnswerRe: C sharp windows application development Pin
OriginalGriff23-Jun-14 2:32
mveOriginalGriff23-Jun-14 2:32 
AnswerRe: C sharp windows application development Pin
Kornfeld Eliyahu Peter23-Jun-14 2:59
professionalKornfeld Eliyahu Peter23-Jun-14 2:59 
AnswerRe: C sharp windows application development Pin
Swinkaran23-Jun-14 15:15
professionalSwinkaran23-Jun-14 15:15 
AnswerRe: C sharp windows application development Pin
V.23-Jun-14 20:12
professionalV.23-Jun-14 20:12 

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.