本文整理汇总了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();
}
}
示例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];
}
示例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;
}
示例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;
}
示例5: GetAllFeesSetup
public static DataSet GetAllFeesSetup()
{
db = DatabaseFactory.CreateDatabase();
sqlCommand = "[dbo].TMS_GetFeesSetup";
dbCommand = db.GetStoredProcCommand(sqlCommand);
ds = db.ExecuteDataSet(dbCommand);
return ds;
}
示例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();
}
}
示例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,"");
}
}
示例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];
}
示例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"]);
}
示例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;
}
}
}
示例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];
}
示例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;
}
示例13: getDepartment
public DataSet getDepartment()
{
Database db = new Database(ConnectionManager.GetDatabaseConnectionString());
return db.ExecuteDataSet("fb_amad_GetDepartments");
}
示例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;
}
示例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];
}