hi Mpilo,put your connection in your connection string in your web.config file and reference it with the variable name. e.g.Here is an example that takes one variable "variable_name" from a class called classname. Hope this helps 
<connectionStrings> <add name="Mpilo" connectionString="Data Source=00.111.123.877,2433;Network Library=DBMSSOCN;Initial Catalog=mpilos_Database_name;User ID=mpilos;Password=mpilospassword;" providerName="System.Data.SqlClient"/> </connectionStrings>
And in your class public class classname{ public classname(string variable_name) { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Mpilo"].ConnectionString.ToString()); SqlCommand command = new SqlCommand("SP_Name", con); command.CommandType = CommandType.StoredProcedure; command.CommandTimeout = 20; con.Open(); command.Parameters.Add(new SqlParameter("@example", SqlDbType.VarChar, 200, "variable_name")); command.Parameters[0].Value = variable_name; int i = command.ExecuteNonQuery(); con.Close();And in your code behind aspx.cs class, you can call the class as thusclassname newclass = classname(variable_name);