Check out example codes for "sql connection c#". It will help you in understanding the concepts better.

Code Example 1

private static void CreateCommand(string queryString,
    string connectionString)
{
    using (SqlConnection connection = new SqlConnection(
               connectionString))
    {
        SqlCommand command = new SqlCommand(queryString, connection);
        command.Connection.Open();
        command.ExecuteNonQuery();
    }
}

Learn ReactJs, React Native from akashmittal.com