当前位置: 首页>>代码示例>>C#>>正文


C# Database.ExecuteDataSet方法代码示例

本文整理汇总了C#中Database.ExecuteDataSet方法的典型用法代码示例。如果您正苦于以下问题:C# Database.ExecuteDataSet方法的具体用法?C# Database.ExecuteDataSet怎么用?C# Database.ExecuteDataSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Database的用法示例。


在下文中一共展示了Database.ExecuteDataSet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Database db=new Database();
            Lang lang=new Lang();

            string albumsSql = "select top(4) * from albums where [email protected] order by showOrder";
            string aboutSql = "select  * from pages where [email protected] and [email protected]";
            db.AddParameter("@lang", lang.getCurrentLang());
            if (Request.QueryString["page"] != null)
            {
                db.AddParameter("@key", Request.QueryString["page"]);
            }
            else
            {
                db.AddParameter("@key", "HomeAbout");
            }

            DataSet ds = db.ExecuteDataSet(aboutSql+";"+albumsSql);
            Repeater1.DataSource = ds.Tables[0];
            Repeater1.DataBind();

            Repeater2.DataSource = ds.Tables[1];
            Repeater2.DataBind();

        }
    }
开发者ID:samercs,项目名称:NCSS,代码行数:28,代码来源:About.aspx.cs

示例2: LoadData

 void LoadData()
 {
     Database db = new Database();
     System.Data.DataSet ds = db.ExecuteDataSet("select * from " + tablename + " order by id desc" + ";" + "");
     RepeaterLists.DataSource = ds.Tables[0];
     RepeaterLists.DataBind();
     Cache["dt1"] = ds.Tables[0];
 }
开发者ID:samercs,项目名称:ArchiveSystem,代码行数:8,代码来源:PagesList.aspx.cs

示例3: FilterFeesCategories

    public static DataSet FilterFeesCategories(string filter)
    {
        db = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].TMS_FilterFeesCategories";
        dbCommand = db.GetStoredProcCommand(sqlCommand,filter);

        ds = db.ExecuteDataSet(dbCommand);
        return ds;
    }
开发者ID:rintujrajan,项目名称:SchoolERP_A,代码行数:9,代码来源:TMSFeesCategoryMaster.cs

示例4: GetFeesTermbyMonthIDAndFeeCategoryID

    public static DataSet GetFeesTermbyMonthIDAndFeeCategoryID(int FeeCategoryID, int Month)
    {
        db = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].TMS_GetFeesTermbyMonthIDAndFeeCategoryID";
        dbCommand = db.GetStoredProcCommand(sqlCommand, FeeCategoryID,Month);

        ds = db.ExecuteDataSet(dbCommand);
        return ds;
    }
开发者ID:rintujrajan,项目名称:SchoolERP_A,代码行数:9,代码来源:TMSFeesTerm.cs

示例5: GetAllFeesSetup

    public static DataSet GetAllFeesSetup()
    {
        db = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].TMS_GetFeesSetup";
        dbCommand = db.GetStoredProcCommand(sqlCommand);

        ds = db.ExecuteDataSet(dbCommand);
        return ds;
    }
开发者ID:rintujrajan,项目名称:SchoolERP_A,代码行数:9,代码来源:TMSFeesSetup.cs

示例6: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Database db=new Database();
            Lang lan=new Lang();

            string showcaseSql = "select * from Showcase where [email protected] order by showorder";
            string aboutHomeSql = "select * from Pages where [email protected] and [email protected]";
            string partnerSql = "select * from Partners where [email protected] Order By ShowOrder";
            string PublicationsSql = "select top(2) * from Publications where [email protected] Order By id desc";
            string newsSql = "select top(2) * from News where [email protected] Order By id desc";
            string publicResearchSql = "select top(5) * from Library where [email protected] Order By Id Desc";

            db.AddParameter("@lang", lan.getCurrentLang());
            db.AddParameter("@homeAbout", "HomeAbout");

            DataSet ds = db.ExecuteDataSet(showcaseSql+";"+aboutHomeSql+";"+partnerSql+";"+PublicationsSql+ ";"+newsSql+";"+publicResearchSql);
            Repeater1.DataSource = ds.Tables[0];

            if (ds.Tables[0].Rows.Count < 1)
            {

                myCarousel.Visible = false;
            }
            else
            {
                myCarousel.Visible = true;
            }
            Repeater1.DataBind();

            Repeater2.DataSource = ds.Tables[1];
            Repeater2.DataBind();

            Repeater3.DataSource = ds.Tables[2];
            Repeater3.DataBind();

            Repeater4.DataSource = ds.Tables[3];
            Repeater4.DataBind();

            Repeater5.DataSource = ds.Tables[4];
            Repeater5.DataBind();

            Repeater6.DataSource = ds.Tables[5];
            Repeater6.DataBind();
            LoadPoll();

        }
    }
开发者ID:samercs,项目名称:NCSS,代码行数:49,代码来源:Default.aspx.cs

示例7: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {

            txtTitle.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {__doPostBack('" + btnSearch.UniqueID + "','');}} ");
            txtFrom.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {__doPostBack('" + btnSearch.UniqueID + "','');}} ");
            txtTo.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {__doPostBack('" + btnSearch.UniqueID + "','');}} ");

            int id =0;
            if (Request.QueryString["id"] != null )
            {
                int.TryParse(Request.QueryString["id"], out id);
            }

            Database db=new Database();
            Lang lang=new Lang();

            string catNameSql = "select title,titleAr from ResearchType where [email protected]";

            db.AddParameter("@id", id);

            DataSet ds = db.ExecuteDataSet(catNameSql);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (Page.Culture.Contains("Arabic"))
                {
                    lblcatname.Text = ds.Tables[0].Rows[0]["TitleAr"].ToString();
                }
                else
                {
                    lblcatname.Text = ds.Tables[0].Rows[0]["Title"].ToString();
                }

            }

            ddlLang.Items.Add(new ListItem(lang.getByKey("All"),"-1"));
            ddlLang.Items.Add(new ListItem(lang.getByKey("English"),"1"));
            ddlLang.Items.Add(new ListItem(lang.getByKey("Arabic2"), "2"));

            SearchLibrary("",null,null,"");
        }
    }
开发者ID:samercs,项目名称:NCSS,代码行数:43,代码来源:library.aspx.cs

示例8: LoadData

 void LoadData()
 {
     Database db = new Database();
     System.Data.DataSet ds = db.ExecuteDataSet("select files.title as filename,users.name as username,FileComment.* from ((FileComment inner join users on (FileComment.UserId=Users.id)) inner join files on (FileComment.FileId=files.id))  Order By FileComment.AddDate desc");
     RepeaterLists.DataSource = ds.Tables[0];
     RepeaterLists.DataBind();
     Cache["dt1"] = ds.Tables[0];
 }
开发者ID:samercs,项目名称:ArchiveSystem,代码行数:8,代码来源:FileCommentList.aspx.cs

示例9: LoadData

 void LoadData()
 {
     Database db = new Database();
     db.AddParameter("@id", Request.QueryString["id"]);
     System.Data.DataSet ds = db.ExecuteDataSet("select * from " + tablename+" where [email protected]");
     RepeaterLists.DataSource = ds.Tables[0];
     RepeaterLists.DataBind();
     Cache["dt1"] = ds.Tables[0];
     name += " " + db.GetProName("Researcher", "name", "id", Request.QueryString["id"]);
 }
开发者ID:samercs,项目名称:NCSS,代码行数:10,代码来源:ResearchList.aspx.cs

示例10: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Database db=new Database();
            Lang lang = new Lang();

            db.AddParameter("@lang",lang.getCurrentLang());

            string researchTypeSql = "select id,title  from ResearchType";
            if (Page.Culture.Contains("Arabic"))
            {
                researchTypeSql = "select id,titleAr as title  from ResearchType";
                btnChangeLang.Text = lang.getByKey("English");
                btnLang.Text = lang.getByKey("English");
            }
            else
            {
                btnLang.Text = lang.getByKey("Arabic");
                btnChangeLang.Text= lang.getByKey("Arabic");
            }

            DataSet ds = db.ExecuteDataSet(researchTypeSql);
            Repeater1.DataSource = ds.Tables[0];
            Repeater1.DataBind();

            string pageName = System.IO.Path.GetFileName(Request.PhysicalPath).ToLower();
            switch (pageName)
            {
                case "default.aspx":
                    HomeLink.Attributes.Add("class","selected");
                    break;
                case "about.aspx":
                case "organizationalstructure.aspx":
                    AboutLink.Attributes.Add("class", "selected");
                    break;
                case "library.aspx":
                    LibraryLink.Attributes.Add("class", "selected");
                    break;
                case "experts.aspx":
                case "researcher.aspx":
                case "researchersform.aspx":
                    ExpertsLink.Attributes.Add("class", "selected");
                    break;
                case "phenomenon.aspx":
                case "phenomenondetails.aspx":
                    PhenomenonLink.Attributes.Add("class", "selected");
                    break;
                case "events.aspx":
                    EventLink.Attributes.Add("class", "selected");
                    break;
                case "publications.aspx":
                case "publicationsdetails.aspx":
                    PublicationLink.Attributes.Add("class", "selected");
                    break;
                case "mediacenter.aspx":
                case "newsdetails.aspx":
                case "reportdetails.aspx":
                    MediaCenterLink.Attributes.Add("class", "selected");
                    break;
                case "contactus.aspx":
                    ContactUsLink.Attributes.Add("class", "selected");
                    break;
            }

        }
    }
开发者ID:samercs,项目名称:NCSS,代码行数:67,代码来源:Header.ascx.cs

示例11: LoadData

    void LoadData(string filename="",string no="",string field="")
    {
        Database db = new Database();
        string where = "where 1=1 ";
        if (!string.IsNullOrWhiteSpace(filename))
        {
            where += " and Files.title like '%' + @title + '%' ";
            db.AddParameter("@title", filename);
        }

        if (!string.IsNullOrWhiteSpace(no))
        {
            where += " and Files.[no] like '%' + @no + '%' ";
            db.AddParameter("@no", no);
        }

        if (!field.Equals("-1") && !string.IsNullOrWhiteSpace(field))
        {
            where += " and Files.[field] = @Field ";
            db.AddParameter("@Field", field);
        }

        string sql = "Select Files.*,FileType.Title as TypeName,FileTarget.Title as TargetName,FileStatus.Title as StatusName,FileSecurity.Title as SecurityName from ((((Files left join AdminUsers on (Files.AddedBy=AdminUsers.Id) inner join fileType on (Files.type=FileType.id) ) inner join FileTarget on (Files.Target=FileTarget.Id) ) inner join FileStatus on (files.Status=FileStatus.Id)) inner join FileSecurity on (Files.Security=FileSecurity.Id))" + where+" Order By Files.Id desc";

        System.Data.DataSet ds = db.ExecuteDataSet(sql);
        RepeaterLists.DataSource = ds.Tables[0];
        RepeaterLists.DataBind();
        Cache["dt1"] = ds.Tables[0];
    }
开发者ID:samercs,项目名称:ArchiveSystem,代码行数:29,代码来源:FileList.aspx.cs

示例12: GetDoctorsDetailsByEmail

 public DataSet GetDoctorsDetailsByEmail(string email)
 {
     DataSet ds = new DataSet();
     AMADBasePage obj = new AMADBasePage();
     Database db = new Database(ConnectionManager.GetDatabaseConnectionString());
     SqlParameter p1 = new SqlParameter("EmailAddress", email);
     SqlParameter p2 = new SqlParameter("RecordStatus", 0);
     p2.Direction = ParameterDirection.Output;
     ds = db.ExecuteDataSet("fb_amad_GetDoctorsDetailsByEmail", p1, p2);
     if (Convert.ToInt32(p2.Value) > 0)
         return ds;
     else
         return null;
 }
开发者ID:pank1982,项目名称:mydoc,代码行数:14,代码来源:Doctors.cs

示例13: getDepartment

 public DataSet getDepartment()
 {
     Database db = new Database(ConnectionManager.GetDatabaseConnectionString());
     return db.ExecuteDataSet("fb_amad_GetDepartments");
 }
开发者ID:pank1982,项目名称:mydoc,代码行数:5,代码来源:Doctors.cs

示例14: GetUserDetailsForActivation

    public static DataSet GetUserDetailsForActivation(string email)
    {
        DataSet ds = new DataSet();
        AMADBasePage obj = new AMADBasePage();
        Database db = new Database(ConnectionManager.GetDatabaseConnectionString());
        SqlParameter p1 = new SqlParameter("EmailAddress", email);
        ds = db.ExecuteDataSet("fb_amad_GetUserDetailsForActivation", p1);

        return ds;
    }
开发者ID:pank1982,项目名称:mydoc,代码行数:10,代码来源:Users.cs

示例15: LoadData

 void LoadData()
 {
     Database db = new Database();
     System.Data.DataSet ds = db.ExecuteDataSet("select users.username,users.name,msg.* from " + tablename + " inner join users on (Msg.[From] = Users.Id) where isnull(msg.ToId,-1)=-1 Order By Msg.Adddate desc");
     RepeaterLists.DataSource = ds.Tables[0];
     RepeaterLists.DataBind();
     Cache["dt1"] = ds.Tables[0];
 }
开发者ID:samercs,项目名称:ArchiveSystem,代码行数:8,代码来源:MsgList.aspx.cs


注:本文中的Database.ExecuteDataSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。