Ejemplo n.º 1
0
 /// <summary>
 /// ����ID�����Դ����
 /// </summary>
 /// <param name="conn"></param>
 /// <param name="id"></param>
 /// <returns></returns>
 public Speciality GetNewsSpecialityInfoById(Connection conn, int id)
 {
     string SQL = "SELECT iId,iSiteId,iParent,vcTitle,vcExplain,dUpDateDate FROM Speciality (NOLOCK) WHERE iId=" + id.ToString();
     DataTable dt = conn.GetDataTable(SQL);
     if (dt == null) return null;
     if (dt.Rows.Count != 1) return null;
     Speciality item = new Speciality();
     DataRow Row = dt.Rows[0];
     item.iId = (int)Row["iId"];
     item.iSiteId = (int)Row["iSiteId"];
     item.iParent = (int)Row["iParent"];
     item.vcTitle = (string)Row["vcTitle"];
     item.vcExplain = (string)Row["vcExplain"];
     item.dUpDateDate = (DateTime)Row["dUpDateDate"];
     dt.Clear();
     dt.Dispose();
     dt = null;
     Row.Delete();
     return item;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// ���������Դ����
 /// </summary>
 /// <param name="conn"></param>
 /// <returns></returns>
 public DataTable GetAllNewsSpecialityInfo(Connection conn)
 {
     string SQL = "SELECT iId,iSiteId,iParent,vcTitle,vcExplain,dUpDateDate FROM Speciality (NOLOCK)";
     return conn.GetDataTable(SQL);
 }