public void DeleteOne(string _dlt_ap_id, DB_Handle oDB_Handle) { string sqlQuery; SqlCommand oSqlCommand; try { sqlQuery = "SP_DELETE_appointment"; oSqlCommand = new SqlCommand(); oSqlCommand.Parameters.AddWithValue("@appointment_id", Convert.ToInt32(_dlt_ap_id)); oSqlCommand.CommandText = sqlQuery; oSqlCommand.CommandType = CommandType.StoredProcedure; oSqlCommand.Connection = oDB_Handle.GetConnection(); oSqlCommand.Transaction = oDB_Handle.GetTransaction(); oSqlCommand.ExecuteNonQuery(); } catch (Exception ex) { throw ex; } }
public DataTable SelectCar(DB_Handle oDB_Handle) { string sqlQuery; SqlCommand oSqlCommand; DataTable oDataTable = new DataTable(); SqlDataAdapter oSqlDataAdapter; try { sqlQuery = "SP_GET_Car"; oSqlCommand = new SqlCommand(); oSqlCommand.CommandText = sqlQuery; oSqlCommand.CommandType = CommandType.StoredProcedure; oSqlCommand.Connection = oDB_Handle.GetConnection(); oSqlCommand.Transaction = oDB_Handle.GetTransaction(); oSqlDataAdapter = new SqlDataAdapter(oSqlCommand); oSqlDataAdapter.Fill(oDataTable); return(oDataTable); } catch (Exception ex) { throw ex; } }