title: The network path was not found error while run application on web server
body: <p>I had an error in my code when i run this on to the web server given below</p>
  
  <p>This shows an error that <code>network path was not found</code>.
   Please help me to solve this problem.</p>
  
  <pre><code> public class Connection
   {
    public SqlConnection con = new SqlConnection("server=173.192.96.130;Initial Catalog=hrmodule;Integrated Security=false;user=hrmodule1;password=hrmodule@123");
  
      SqlConnection getconnection()
      {
          return con;
      }
      public void openconn()
      {
          **con.Open();** the error occur on this line
  
      }
      public void closeconn()
      {
          con.Close();
      }
  
      public DataTable GetData(string query)
      {
          SqlDataAdapter da = new SqlDataAdapter(query, getconnection());
          DataTable dt = new DataTable();
          da.Fill(dt);
          return dt;
      }
      public void Storepro(string sp, string[] pn, string[] pt, string[] pv, int nos)
      {
          SqlCommand cmd = new SqlCommand(sp, con);
          cmd.CommandType = CommandType.StoredProcedure;
          for (int i = 0; i &lt; nos; i++)
          {
              switch (pt[i])
              {
                  case "string":
                      cmd.Parameters.AddWithValue(pn[i], pv[i]);
                      break;
                  case "int":
                      cmd.Parameters.AddWithValue(pn[i], Convert.ToInt32(pv[i]));
                      break;
                  case "decimal":
                      cmd.Parameters.AddWithValue(pn[i], Convert.ToDecimal(pv[i]));
                      break;
                  case "DateTime":
                      cmd.Parameters.AddWithValue(pn[i], Convert.ToDateTime(pv[i]));
                      break;
              }
  
          }
          con.Open();
          cmd.ExecuteNonQuery();
          con.Close();
      }
  
  
   }
  </code></pre>