/// <summary> /// ִ���������XmlReader /// </summary> /// <param name="q">SqlQuery����</param> /// <param name="dp">Sql��������</param> /// <returns>XmlReader</returns> public static XmlReader ExecuteXmlReader(SqlQuery q, DatabaseProperty dp) { SqlDataAccess da = new SqlDataAccess(dp.ConnectionString); da.Open(); return da.ExecuteXmlReader(q); }
/// <summary> /// ִ���������Xml�ĵ� /// </summary> /// <param name="q">SqlQuery����</param> /// <param name="dp">Sql��������</param> /// <returns>Xml�ĵ�</returns> public static XmlDocument ExecuteXmlDoc(SqlQuery q, DatabaseProperty dp) { SqlDataAccess da = new SqlDataAccess(dp.ConnectionString); da.Open(); XmlDocument doc = da.ExecuteXmlDoc(q); da.Close(); return doc; }
/// <summary> /// ִ����������������е�Object /// </summary> /// <param name="q">SqlQuery����</param> /// <param name="dp">Sql��������</param> /// <returns>�������е�Object</returns> public static Object ExecuteScalar(SqlQuery q, DatabaseProperty dp) { SqlDataAccess da = new SqlDataAccess(dp.ConnectionString); da.Open(); object scalar = da.ExecuteScalar(q); da.Close(); return scalar; }
/// <summary> /// ִ���������Ӱ������ /// </summary> /// <param name="q">SqlQuery����</param> /// <param name="dp">Sql��������</param> /// <returns>Ӱ������</returns> public static int ExecuteNonQuery(SqlQuery q, DatabaseProperty dp) { SqlDataAccess da = new SqlDataAccess(dp.ConnectionString); da.Open(); int affectRows = da.ExecuteNonQuery(q); da.Close(); return affectRows; }
/// <summary> /// ִ���������Dataset /// </summary> /// <param name="q">SqlQuery����</param> /// <param name="dp">Sql��������</param> /// <returns>Dataset</returns> public static DataSet ExecuteDataset(SqlQuery q, DatabaseProperty dp) { SqlDataAccess da = new SqlDataAccess(dp.ConnectionString); da.Open(); DataSet ds = da.ExecuteDataset(q); da.Close(); return ds; }
/// <summary> /// ִ�� /// </summary> public void Execute() { CheckValue(); m_DataAccess = DataAccessFactory.CreateSqlDataAccess(this.m_ConnectionString); m_DataAccess.Open(); try { this.m_RecordCount = GetRecordCount(); this.m_PageCount = m_RecordCount / m_PageSize + ((m_RecordCount % m_PageSize == 0) ? 0 : 1); if (this.m_PageNumber > this.m_PageCount) this.m_PageNumber = this.m_PageCount > 0 ? this.m_PageCount : 1; this.m_Data = GetPageData(); m_IsExecuted = true; } finally { if (!m_DataAccess.IsClosed) m_DataAccess.Close(); } }