public InstituteData getInstitute(string institute_code) { InstituteData Institute_data = new InstituteData(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); oracleObj.SelectCommand = "Select * From GRAD_INSTITUTE Where INSTITUTE_CODE='" + institute_code + "'"; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { Institute_data.Institute_Code = rowData["INSTITUTE_CODE"].ToString(); Institute_data.Institute_Thai = rowData["INSTITUTE_THAINAME"].ToString(); Institute_data.Institute_Eng = rowData["INSTITUTE_ENGNAME"].ToString(); Institute_data.Institute_ProvinceCode = rowData["INSTITUTE_PROVINCE_CODE"].ToString(); } return(Institute_data); }
public List <InstituteData> getInstitute() { List <InstituteData> Institute_data = new List <InstituteData>(); ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); oracleObj.SelectCommand = "Select * From GRAD_INSTITUTE Order By INSTITUTE_CODE"; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { InstituteData Institute = new InstituteData(); Institute.Institute_Code = rowData["INSTITUTE_CODE"].ToString(); Institute.Institute_Thai = rowData["INSTITUTE_THAINAME"].ToString(); Institute.Institute_Eng = rowData["INSTITUTE_ENGNAME"].ToString(); Institute.Institute_ProvinceCode = rowData["INSTITUTE_PROVINCE_CODE"].ToString(); Institute_data.Add(Institute); } return(Institute_data); }