本文整理汇总了C#中SqlDataSourceSelectingEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# SqlDataSourceSelectingEventArgs类的具体用法?C# SqlDataSourceSelectingEventArgs怎么用?C# SqlDataSourceSelectingEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlDataSourceSelectingEventArgs类属于命名空间,在下文中一共展示了SqlDataSourceSelectingEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: sqlcompanySearch
protected void sqlcompanySearch(object sender, SqlDataSourceSelectingEventArgs e)
{
if (String.IsNullOrEmpty(txtCname.Text))
{
e.Cancel = true;
}
}
示例2: onItemSelecting
protected void onItemSelecting(object sender, SqlDataSourceSelectingEventArgs e)
{
string asin = Request.QueryString["asin"];
// Assign asin to select parameter
e.Command.Parameters["@asin"].Value = asin;
}
示例3: DSData_Selecting
protected void DSData_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
if (sessionMemberCard.IsAdmin)
{
e.Command.CommandText = @"SELECT [MemberId], [MemberName], [closed],
(SELECT Syndicate FROM CDSyndicate WHERE SyndicateId = TBLAllMember.SyndicateId) AS Syndicate,
(SELECT SubCommitte FROM CDSubCommitte WHERE SubCommitteId = TBLAllMember.SubCommitteId) AS SubCommitte
FROM [TBLAllMember]";
}
else
{
if (sessionMemberCard.usersub == sessionMemberCard.UserSubType.SubType)
{
e.Command.CommandText = @"SELECT [MemberId], [MemberName], [closed],
(SELECT Syndicate FROM CDSyndicate WHERE SyndicateId = TBLAllMember.SyndicateId) AS Syndicate,
(SELECT SubCommitte FROM CDSubCommitte WHERE SubCommitteId = TBLAllMember.SubCommitteId) AS SubCommitte
FROM [TBLAllMember] WHERE closed = False AND userin = " + sessionMemberCard.UserID;
}
else if(sessionMemberCard.usersub == sessionMemberCard.UserSubType.SubSyn)
{
e.Command.CommandText = @"SELECT [MemberId], [MemberName], [closed],
(SELECT Syndicate FROM CDSyndicate WHERE SyndicateId = TBLAllMember.SyndicateId) AS Syndicate,
(SELECT SubCommitte FROM CDSubCommitte WHERE SubCommitteId = TBLAllMember.SubCommitteId) AS SubCommitte
FROM [TBLAllMember] WHERE closed = False AND SyndicateId = " + sessionMemberCard.SyndicateId;
}
}
}
示例4: DSCDSyndicate_Selecting
protected void DSCDSyndicate_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
if (TheSessions.IsAdmin)
e.Command.CommandText = "SELECT [SyndicateId], [Syndicate] FROM [CDSyndicate]";
else
e.Command.CommandText = "SELECT [SyndicateId], [Syndicate] FROM [CDSyndicate] WHERE SyndicateId = " + TheSessions.SyndicateId;
}
示例5: dsTasks_Selecting
protected void dsTasks_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
string qryCat = Request.QueryString["cid"];
string qrySubCat = Request.QueryString["scid"];
string qryServ = Request.QueryString["ser"];
string qrySec = Request.QueryString["sec"];
string qryEmp = Request.QueryString["eid"];
string qrySta = Request.QueryString["sta"];
string qryRev = Request.QueryString["rev"];
string qryCom = Request.QueryString["com"];
string qryRec = Request.QueryString["rec"];
string qrySort = Request.QueryString["srt"];
string qryDdline = Request.QueryString["dl"];
//Before passing all those query string parameters wrap those bad boys in wildcards if they're empty, if not set each control value and border colour
if (qryCat != null)
{ dropCategory.SelectedValue = qryCat; dropCategory.BorderColor = Color.Black; SelectSubCategory(); }
else { e.Command.Parameters["@category"].Value = "%" + e.Command.Parameters["@category"].Value + "%"; }
if (qrySubCat != null)
{ dropSubcategory.SelectedValue = qrySubCat; dropSubcategory.BorderColor = Color.Black; }
else { e.Command.Parameters["@subcat"].Value = "%" + e.Command.Parameters["@subcat"].Value + "%"; }
if (qryServ != null)
{ dropService.SelectedValue = qryServ; dropService.BorderColor = Color.Black; }
else { e.Command.Parameters["@service"].Value = "%" + e.Command.Parameters["@service"].Value + "%"; }
if (qrySec != null)
{ dropSection.SelectedValue = qrySec; dropSection.BorderColor = Color.Black; SelectEmployee(); }
else { e.Command.Parameters["@section"].Value = "%" + e.Command.Parameters["@section"].Value + "%"; }
if (qryEmp != null)
{ dropEmployee.SelectedValue = qryEmp; dropEmployee.BorderColor = Color.Black; }
else { e.Command.Parameters["@employee"].Value = "%" + e.Command.Parameters["@employee"].Value + "%"; }
if (qrySta != null)
{ dropStatus.SelectedValue = qrySta; dropStatus.BorderColor = Color.Black; }
else { e.Command.Parameters["@status"].Value = "%" + e.Command.Parameters["@status"].Value + "%"; }
if (qryRev != null)
{ dropReview.SelectedValue = qryRev; dropReview.BorderColor = Color.Black; }
else { e.Command.Parameters["@review"].Value = "%" + e.Command.Parameters["@review"].Value + "%"; }
if (qryCom == "1")
{ chkCom.Checked = true; chkCom.ForeColor = Color.Maroon; }
else { e.Command.Parameters["@committee"].Value = "%" + e.Command.Parameters["@committee"].Value + "%"; }
if (qryRec == "1")
{ chkRec.Checked = true; chkRec.ForeColor = Color.Maroon; }
else { e.Command.Parameters["@recurring"].Value = "%" + e.Command.Parameters["@recurring"].Value + "%"; }
if (qryDdline == "1")
{ chkDeadline.Checked = true; chkDeadline.ForeColor = Color.Maroon; }
else { chkDeadline.Checked = false; }
if (qrySort != null)
{ dropSort.SelectedValue = qrySort; }
}
示例6: DSData_Selecting
protected void DSData_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
// if (sessionMaintenance.MaintenanceIsAdmin)
// {
// e.Command.CommandText = @"SELECT Maintenance.MaintenanceId, Maintenance.MaintenanceDate, Maintenance.maddres, Maintenance.mclosed, Users.realname, Maintenance.read_code FROM
// (Maintenance LEFT OUTER JOIN Users ON Maintenance.UserID = Users.UserID)";
// }
}
示例7: departmentDataSource_Selecting
protected void departmentDataSource_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
DropDownList buDropDownList = (DropDownList)NfteDetailsView.FindControl("buDropDownList");
DropDownList deptDropDownList = (DropDownList)NfteDetailsView.FindControl("deptDropDownList");
if (deptDropDownList != null)
{
e.Command.Parameters["@bu_id"].Value = buDropDownList.SelectedValue;
}
}
示例8: DSData_Selecting
protected void DSData_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
//SELECT studentcode FROM download WHERE (id_prog = ?)
string dbpath = MCDownloadCenter.LoginDatabasePath.Substring(0, MCDownloadCenter.LoginDatabasePath.Length - 4);
e.Command.CommandText = string.Format(@"SELECT studentcode, downdate,
(SELECT stu_name FROM {0}.student WHERE stu_code = download.studentcode) AS stu_name,
(SELECT alsofof_name FROM alsofof WHERE alsofof_code = (SELECT alsofof_code FROM {0}.student_t WHERE stu_code = download.studentcode AND asase_code = (SELECT MAX(asase_code) FROM {0}.student_t))) AS alsofof_name,
(SELECT faslname FROM fasl WHERE faslcode = (SELECT fasl_code FROM {0}.student_t WHERE stu_code = download.studentcode AND asase_code = (SELECT MAX(asase_code) FROM {0}.student_t))) AS name_al_fasl
FROM download WHERE (id_prog = {1})", dbpath, Request.QueryString["id"]);
}
示例9: DSData_Selecting
protected void DSData_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
if (sessionMemberCard.IsAdmin)
{
e.Command.CommandText = @"SELECT tblestefa.MemberId, tblestefa.SyndicateId, tblestefa.SubCommitteId,
tblestefa.MemberName, tblestefa.resoon, tblestefa.datein, CDSyndicate.Syndicate,
CDSubCommitte.SubCommitte FROM ((tblestefa LEFT OUTER JOIN
CDSubCommitte ON tblestefa.SubCommitteId = CDSubCommitte.SubCommitteId) LEFT OUTER JOIN
CDSyndicate ON tblestefa.SyndicateId = CDSyndicate.SyndicateId)";
}
}
示例10: SqlDataSource1_Selecting
protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
//使用SqlDataSourceSelectingEventArgs的Command属性获取当前的命令对象。
//然后使用命令对象的Parameters集合来获取参数值。
if ((int)e.Command.Parameters[0].Value == 7)
{
//如果参数值为7,则停止查询的执行
e.Cancel = true;
}
// e.Command.CommandText = "select * from product";
}
示例11: DSData_Selecting
protected void DSData_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
if (!TheSessions.IsAdmin)
{
e.Command.CommandText = @"SELECT [MemberId], [MemberName] FROM [TBLMembers] WHERE ([SyndicateId] = " + TheSessions.SyndicateId + ") order by MemberName";
}
else
{
e.Command.CommandText = @"SELECT [MemberId], [MemberName] FROM [TBLMembers] WHERE ([SyndicateId] = ?) order by MemberName";
}
}
示例12: UserProfileDataSource_Selecting
protected void UserProfileDataSource_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
// Get a reference to the currently logged on user
MembershipUser currentUser = Membership.GetUser();
// Determine the currently logged on user's UserId value
Guid currentUserId = (Guid)currentUser.ProviderUserKey;
// Assign the currently logged on user's UserId to the @UserId parameter
e.Command.Parameters["@UserId"].Value = currentUserId;
}
示例13: DSData_Selecting
protected void DSData_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
if (sessionRetirementWeb.SubCommitteId != null)
{
e.Command.CommandText = string.Format(@"SELECT [rid], [sonid], [sonname], [SyndicateId], [SubCommitteId], [sarfnumber], [remark], [membername] FROM [stopsarf]
WHERE SyndicateId = {0} AND SubCommitteId = {1}", sessionRetirementWeb.SyndicateId, sessionRetirementWeb.SubCommitteId);
}
else
{
e.Command.CommandText = string.Format(@"SELECT [rid], [sonid], [sonname], [SyndicateId], [SubCommitteId], [sarfnumber], [remark], [membername] FROM [stopsarf] WHERE SyndicateId = {0}", sessionRetirementWeb.SyndicateId);
}
}
示例14: sourceEmployees_Selecting
protected void sourceEmployees_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
if ((string)e.Command.Parameters["@City"].Value == "(Choose a City)")
{
// Do nothing.
e.Cancel = true;
}
else if ((string)e.Command.Parameters["@City"].Value == "(All Cities)")
{
// Manually change the command.
e.Command.CommandText = "SELECT * FROM Employees";
}
}
示例15: DSData_Selecting
protected void DSData_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
if (sessionRetirementWeb.SubCommitteId != null)
{
e.Command.CommandText = string.Format(@"SELECT [memberid], [membername], [sarfno], [SyndicateId], [SubCommitteId], [useredit], [dateedit], [delmember], [remm] FROM [tblwarasa]
WHERE SyndicateId = {0} AND SubCommitteId = {1}", sessionRetirementWeb.SyndicateId, sessionRetirementWeb.SubCommitteId);
}
else
{
e.Command.CommandText = string.Format(@"SELECT [memberid], [membername], [sarfno], [SyndicateId], [SubCommitteId], [useredit], [dateedit], [delmember], [remm]
FROM [tblwarasa] WHERE SyndicateId = {0}", sessionRetirementWeb.SyndicateId);
}
}