The value of the PipeName property depends on MySQL server 'socket' option. On Windows this option specifies the pipe name to use when listening for local connections that use a named pipe.
The default value is MySQL (case-insensitive).
This feature is not available in Mobile edition.
// set name of pipe as parameter of connection string string connectionString = "user id=root;password=root;host=localhost;database=test;Pipe Name=My_Test"; MySqlConnection connection = new MySqlConnection(connectionString); // sets the protocol type connection.Protocol = MySqlProtocol.Pipe; connection.Open(); Console.WriteLine(connection.State); //Another way to set up a connetion //set name of pipe as property of MySqlConnectionStringBuilder instanse string connectionString = "user id=root;password=root;host=localhost;database=test"; MySqlConnectionStringBuilder connStrBuilder = new MySqlConnectionStringBuilder(connectionString); connStrBuilder.PipeName = "My_Test"; MySqlConnection connection = new MySqlConnection(connStrBuilder.ConnectionString); // sets the protocol type connection.Protocol = MySqlProtocol.Pipe; connection.Open(); Console.WriteLine(connection.State);
' set name of pipe as parameter of connection string Dim connectionString As String = "user id=root;password=root;host=localhost;database=test;Pipe Name=My_Test" Dim connection As MySqlConnection = New MySqlConnection(connectionString) ' sets the protocol type connection.Protocol = MySqlProtocol.Pipe connection.Open() Console.WriteLine(connection.State.ToString()) ' Another way to set up a connetion ' set name of pipe as property of MySqlConnectionStringBuilder instanse Dim connectionString As String = "user id=root;password=root;host=localhost;database=test" Dim connStrBuilder As MySqlConnectionStringBuilder = New MySqlConnectionStringBuilder(connectionString) connStrBuilder.PipeName = "My_Test" Dim connection As MySqlConnection = New MySqlConnection(connStrBuilder.ConnectionString) ' sets the protocol type connection.Protocol = MySqlProtocol.Pipe connection.Open() Console.WriteLine(connection.State.ToString())
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2