title: Is it safe to use static methods for accessing database in following scenario
body: <p>I am upgrading a asp website to asp.net. I am trying to follow multi teir approach.
  My basic dal layer is as follows which returns a datatable and insert a given query.</p>
  
  <pre><code>using System;
  using System.Configuration;
  using System.Data;
  using MySql.Data.MySqlClient;
  
  public class mydatautility
  {
      public mydatautility()
      {
      }
      public static DataTable Table(string query)
      {
          string constr = ConfigurationManager.ConnectionStrings["db_con"].ConnectionString;
          DataTable table = new DataTable();
          try
          {
              using (MySqlConnection con = new MySqlConnection(constr))
              {
                  con.Close();
                  MySqlCommand com = new MySqlCommand(query, con);
                  MySqlDataAdapter da = new MySqlDataAdapter(com);
                  con.Open();
                  da.Fill(table);
                  con.Close();
                  da = null;
                  com = null;
                  con.Dispose();
              }
          }
          catch (Exception)
          {
          }
          return table;
      }
      public static int Insert_intoemployee(string query)
      {
          string constr = ConfigurationManager.ConnectionStrings["db_con"].ConnectionString;
          int done = 0;
          try
          {
              using (MySqlConnection con = new MySqlConnection(constr))
              {
                  MySqlCommand com = new MySqlCommand(query, con);
                  con.Open();
                  done = com.ExecuteNonQuery();
                  con.Close();
                  com = null;
                  con.Dispose();
              }
          }
          catch (Exception)
          {
          }
          return done;
      }
  }
  </code></pre>
  
  <p>I am not sure what will happen when 2 concurrent queries are run.<br/>How can I test it for concurrency problem?</p>