×Welcome aboard! We are happy you are here and wish you good net-raft!



Together We Can Simplify The World
Just a Web Code Solution

the current number of solutions:  2529

You Can Join us too!

it news shareTrending in the Internet industry

Discover and Share trending in the Internet industry from all around the world.
Click to see more ...

  19     276

mysql connection string c#

(c# mysql connection string )

- C#

 119

created: 8 months agoC#

0

// add reference MySgl.Data

using System;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string connetionString = null;
MySqlConnection cnn ;
connetionString = "server=localhost;database=testDB;uid=root;pwd=xxx;";
cnn = new MySqlConnection(connetionString);
try
{
cnn.Open();
MessageBox.Show ("The connection is open!");
cnn.Close();
}
catch (Exception ex)
{
MessageBox.Show("The connection is refused!");
}
}
}
}

     

The power of the user (%)

5%



The most helpful C# solutions

detect ie C#detect ie C#C#

Click to see more ...

  2K     833

Get real client ip address using C# ?Get real client ip address using C# ?C#

Click to see more ...

  676     241

get city country region timezone c#get city country region timezone c#C#

Click to see more ...

  432     162

get real user country C#get real user country C#C#

Click to see more ...

  370     142

Get real client latitude and longitude using C# ?Get real client latitude and longitude using C# ?C#

Click to see more ...

  310     124

how to initialize a connection to mysql database using C# ?how to initialize a connection to mysql database using C# ?C#

Click to see more ...

  265     121

get hostname using C#get hostname using C#C#

Click to see more ...

  226     112

how to detect the type of a browser using C# in asp.net ?how to detect the type of a browser using C# in asp.net ?C#

Click to see more ...

  190     59

get real user country code C#get real user country code C#C#

Click to see more ...

  148     56

get username using C#get username using C#C#

Click to see more ...

  120     47