using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace ConnectionDLL
{
    public partial class UserControl1: UserControl
    {
        public UserControl1()
        {
            InitializeComponent();
        }
        public string strConnection;
        public SqlConnection connect;

        private void button1_Click(object sender, EventArgs e)
        {
            strConnection = "Data Source = " + textBox1.Text.Trim() +
                "; Initial Catalog = " + textBox2.Text.Trim() +
                "; Integrated Security = True";
            connect = new SqlConnection(strConnection);
            connect.Open();
            MessageBox.Show("Connection OK");
        }
    }
}
