SqlConnection properties : SqlConnection : Database C# Source Code


Custom Search

C# Source Code » Database » SqlConnection »

 

SqlConnection properties









    


using System;
using System.Data;
using System.Data.SqlClient;

class MySqlConnection {
  public static void Main() {
    string connectionString = "server=(local)\\SQLEXPRESS;database=MyDatabase;Integrated Security=SSPI";

    SqlConnection mySqlConnection = new SqlConnection(connectionString);

    mySqlConnection.Open();

    Console.WriteLine("mySqlConnection.ConnectionString = "+mySqlConnection.ConnectionString);
    Console.WriteLine("mySqlConnection.ConnectionTimeout = "+mySqlConnection.ConnectionTimeout);
    Console.WriteLine("mySqlConnection.Database = "+mySqlConnection.Database);
    Console.WriteLine("mySqlConnection.DataSource = "+mySqlConnection.DataSource);
    Console.WriteLine("mySqlConnection.PacketSize = "+mySqlConnection.PacketSize);
    Console.WriteLine("mySqlConnection.ServerVersion = "+mySqlConnection.ServerVersion);
    Console.WriteLine("mySqlConnection.State = "+mySqlConnection.State);
    Console.WriteLine("mySqlConnection.WorkstationId = "+mySqlConnection.WorkstationId);

    mySqlConnection.Close();
  }
}
           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Database
» SqlConnection