Example #1
0
        public void Delete_Employee(Params_Delete_Employee i_Params_Delete_Employee)
        {
            // You should Always create a complex type (Class) which has properties matching parameters

            // 1. Define Your Connection String


            // 2. Create Sql Connection Object
            using (SqlConnection oConn = new SqlConnection(connStr))
            {
                // 3. Open the Connection
                oConn.Open();

                //4 . Prepare Sql Command Object
                using (SqlCommand command = new SqlCommand("UP_DELETE_EMPLOYEE"))
                {
                    //5. Set the Command Type to Stored Procedure
                    command.CommandType = System.Data.CommandType.StoredProcedure;

                    //6. Inform the Command on Wich connection it should work
                    command.Connection = oConn;

                    command.Parameters.Add(new SqlParameter()
                    {
                        ParameterName = "EMPLOYEE_ID", Value = i_Params_Delete_Employee.EMPLOYEE_ID
                    });

                    command.ExecuteNonQuery();
                }
            }
        }
 public void Delete_Employee(Params_Delete_Employee i_Params_Delete_Employee)
 {
     DALC.DALC oDALC = new DALC.DALC();
     oDALC.connStr = this.connStr;
     oDALC.Delete_Employee(i_Params_Delete_Employee);
 }
Example #3
0
 public void Delete_Employee(Params_Delete_Employee i_Params_Delete_Employee)
 {
     BLC.BLC oBLC = new BLC.BLC();
     oBLC.connStr = this.MyConfig["AppSettings:MyDBConnection"];
     oBLC.Delete_Employee(i_Params_Delete_Employee);
 }