public EducationTypeData getEducationType(string EducationType_Code) { EducationTypeData EducationType_data = new EducationTypeData(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); oracleObj.SelectCommand = "Select * From EDUCATION_TYPE Where EDUCATION_TYPE_CODE='" + EducationType_Code + "'"; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { EducationType_data.EducationType_Code = rowData["EDUCATION_TYPE_CODE"].ToString(); EducationType_data.EducationType_Thai = rowData["EDUCATION_TYPE_THAINAME"].ToString(); EducationType_data.EducationType_Eng = rowData["EDUCATION_TYPE_ENGNAME"].ToString(); } return(EducationType_data); }
public List <EducationTypeData> getEducationType() { List <EducationTypeData> EducationType_data = new List <EducationTypeData>(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); oracleObj.SelectCommand = "Select * From EDUCATION_TYPE Order By EDUCATION_TYPE_CODE"; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { EducationTypeData EducationType = new EducationTypeData(); EducationType.EducationType_Code = rowData["EDUCATION_TYPE_CODE"].ToString(); EducationType.EducationType_Thai = rowData["EDUCATION_TYPE_THAINAME"].ToString(); EducationType.EducationType_Eng = rowData["EDUCATION_TYPE_ENGNAME"].ToString(); EducationType_data.Add(EducationType); } return(EducationType_data); }