protected override object GetDataFromDataRow(DataTable dt, int i) { TINH obj = new TINH(); obj.TIN_ID = int.Parse(dt.Rows[i]["TIN_ID"].ToString()); //some column return((object)obj); }
public void delete(TINH tinh) { SqlParameter[] prams = { MakeInParam("@TIN_ID", SqlDbType.Int, 4, tinh.TIN_ID) }; int errorcode = RunProc("usp_DeleteTINH", prams); if (errorcode > 0) { throw new Exception("Error"); } }
public void update(TINH tinh) { SqlParameter[] prams = { MakeInParam("@TIN_ID", SqlDbType.Int, 4, tinh.TIN_ID), MakeInParam("@TIN_Code", SqlDbType.NVarChar, 10, tinh.TIN_Code), MakeInParam("@TIN_Name", SqlDbType.NVarChar, 20, tinh.TIN_Name) }; int errorcode = RunProc("usp_UpdateTINH", prams); if (errorcode > 0) { throw new Exception("Error"); } }
public DataTable getByID_TINH(TINH tinh) { connect(); DataSet DS = new DataSet(); SqlParameter[] prams = { MakeInParam("@TIN_ID", SqlDbType.Int, 4, tinh.TIN_ID) }; int errorcode = RunProcDS("usp_SelectTINH", prams, out DS); if (errorcode > 0) { throw new Exception("Error!"); } return(DS.Tables[0]); }