Пример #1
0
    /// <summary>
    /// 数据查询
    /// </summary>
    /// <param name="Sql"></param>
    /// <returns></returns>
    public static DataSet GetDataSet(string Sql)
    {
        DataSet DS = new DataSet();

        using (SqlConnection _Conn = new BLL_Document().Connection as SqlConnection)
        {
            _Conn.Open();
            using (SqlCommand _Cmd = new SqlCommand(Sql, _Conn))
            {
                using (SqlDataAdapter _Adp = new SqlDataAdapter(_Cmd))
                {
                    _Adp.Fill(DS);
                }
            }
            _Conn.Close();
            _Conn.Dispose();
        }
        return(DS);
    }