Connecting to SQL SERVER in C#

The minimum requirement to connect to SQL SERVER is Data source name and Integrated security.
The code below is the example for connecting to SQL SERVER with minimal requirements.
using System.Data.SqlClient;

private void btnCheckConnection_Click(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection();
            conn.ConnectionString = "data source=Data source name;integrated security=SSPI;";
            try
            {
                conn.Open();
                MessageBox.Show("Connection was successful");
            }
            catch
            {
                MessageBox.Show("Failed to connect to data source");
            }
            finally
            {
                conn.Close();
            }
        }