本文整理汇总了C#中System.Web.UI.WebControls.SqlDataSourceStatusEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# SqlDataSourceStatusEventArgs类的具体用法?C# SqlDataSourceStatusEventArgs怎么用?C# SqlDataSourceStatusEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlDataSourceStatusEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了SqlDataSourceStatusEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: uxJobSql_Inserted
protected void uxJobSql_Inserted(object sender, SqlDataSourceStatusEventArgs e)
{
//get user id
MembershipUser usr = Membership.GetUser();
Guid uid = (Guid)usr.ProviderUserKey;
//setup database connection
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DB_MYCHURCH"].ConnectionString);
//setup a way to talk to the database
SqlCommand command = new SqlCommand();
command.Connection = connection;
try
{
command.Connection.Open();
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "ChurchJobs_Insert";
command.Parameters.Add(new SqlParameter("@UserId", uid));
command.Parameters.Add(new SqlParameter("@JobID", e.Command.Parameters["@JobID"].Value));
command.ExecuteNonQuery();
}
catch
{
}
finally
{
command.Connection.Close();
}
}
开发者ID:Deliv3rat0r,项目名称:SeniorProject,代码行数:34,代码来源:Jobs.aspx.cs
示例2: SqlDataSourceTurma_Inserted
protected void SqlDataSourceTurma_Inserted(object sender, SqlDataSourceStatusEventArgs e)
{
DataTable dt = new DataTable();
using (SqlConnection SQLconn = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ToString()))
{
SqlCommand cmd = new SqlCommand("Select Id_Disciplina from Tb_Disciplina Where Id_Curso = " + ddlCurso.SelectedValue, SQLconn);
cmd.CommandType = CommandType.Text;
SQLconn.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
SQLconn.Close();
}
if (dt.Rows.Count != 0)
{
foreach (DataRow dr in dt.Rows)
{
SqlDataSourceCurso.InsertParameters["Id_Disciplina"].DefaultValue = dr[0].ToString();
SqlDataSourceCurso.Insert();
}
}
}
开发者ID:Eriksonlove,项目名称:eGEST,代码行数:32,代码来源:CadastrarEstudante.aspx.cs
示例3: SqlDataSourceEscola_Inserted
protected void SqlDataSourceEscola_Inserted(object sender, SqlDataSourceStatusEventArgs e)
{
if (e.Command.Parameters["@Id_Escola"].Value.ToString() != "")
{
Response.Redirect("/Patrimonio/Escola.aspx?Id=" + e.Command.Parameters["@Id_Escola"].Value.ToString());
}
}
开发者ID:Eriksonlove,项目名称:GestINEE,代码行数:7,代码来源:CadastrarEscola.aspx.cs
示例4: sqlAddRepair_Inserted
protected void sqlAddRepair_Inserted(object sender, SqlDataSourceStatusEventArgs e)
{
if (e.Exception == null || e.ExceptionHandled)
{
Response.Redirect("~/admin/admin.aspx");
}
}
开发者ID:jim256,项目名称:TheShop,代码行数:7,代码来源:AddRepair.aspx.cs
示例5: ExecuteSelect
protected internal override IEnumerable ExecuteSelect (
DataSourceSelectArguments arguments)
{
oleCommand = new OleDbCommand (this.SelectCommand, oleConnection);
SqlDataSourceSelectingEventArgs cmdEventArgs = new SqlDataSourceSelectingEventArgs (oleCommand, arguments);
OnSelecting (cmdEventArgs);
IEnumerable enums = null;
Exception exception = null;
OleDbDataReader reader = null;
try {
System.IO.File.OpenRead (dataSource.DataFile).Close ();
oleConnection.Open ();
reader = (OleDbDataReader)oleCommand.ExecuteReader ();
//enums = reader.GetEnumerator ();
throw new NotImplementedException("OleDbDataReader doesnt implements GetEnumerator method yet");
} catch (Exception e) {
exception = e;
}
SqlDataSourceStatusEventArgs statusEventArgs =
new SqlDataSourceStatusEventArgs (oleCommand, reader.RecordsAffected, exception);
OnSelected (statusEventArgs);
if (exception !=null)
throw exception;
return enums;
}
开发者ID:nobled,项目名称:mono,代码行数:26,代码来源:AccessDataSourceView.cs
示例6: dbServiceSql_Inserted
protected void dbServiceSql_Inserted(object sender, SqlDataSourceStatusEventArgs e)
{
//setup database connection
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DB_MYCHURCH"].ConnectionString);
//setup a way to talk to the database
SqlCommand command = new SqlCommand();
command.Connection = connection;
try
{
command.Connection.Open();
command.CommandType = CommandType.Text;
command.CommandText = "INSERT INTO SPScheduleService(ScheduleID, ServiceID) VALUES(@ScheduleID, @ServiceID)";
command.Parameters.Add(new SqlParameter("@ServiceID", e.Command.Parameters["@ServiceID"].Value));
command.Parameters.Add(new SqlParameter("@ScheduleID", sbo.sid.ToString()));
command.ExecuteNonQuery();
}
catch
{
litScheduleInfo.Text = "error";
}
finally
{
command.Connection.Close();
}
}
开发者ID:Deliv3rat0r,项目名称:SeniorProject,代码行数:30,代码来源:Service.aspx.cs
示例7: SchedulingDataSource_Inserted
// DXCOMMENT: This handler is called when a datasource insert operation has been completed
protected void SchedulingDataSource_Inserted(object sender, SqlDataSourceStatusEventArgs e)
{
// DXCOMMENT: This method saves the last inserted appointment's unique identifier
SqlConnection connection = (SqlConnection)e.Command.Connection;
using (SqlCommand cmd = new SqlCommand("SELECT IDENT_CURRENT('Appointments')", connection)) {
this.lastInsertedAppointmentId = Convert.ToInt32(cmd.ExecuteScalar());
}
}
开发者ID:ramyothman,项目名称:RBM,代码行数:9,代码来源:Calendar.aspx.cs
示例8: SqlDataSourceModifica_Deleted
protected void SqlDataSourceModifica_Deleted(object sender, SqlDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
LabelErrorMessage.Text = "Impossibile eseguire la cancellazione probabilmente l'emento è in uso dalla tabella Strumenti.\n" + e.Exception.Message;
e.ExceptionHandled = true;
}
}
开发者ID:PaoloMisson,项目名称:GATEvolution,代码行数:8,代码来源:GestioneMarcaStrumenti.aspx.cs
示例9: allUserGroupsDataSource_Inserted
protected void allUserGroupsDataSource_Inserted( object sender, SqlDataSourceStatusEventArgs e )
{
if ( e.Exception == null )
{
int newGroupId = ( int ) e.Command.Parameters["@NewGroupId"].Value;
Response.Redirect( "~/manageGroup.aspx?group=" + newGroupId );
}
}
开发者ID:new-mikha,项目名称:flytrace,代码行数:8,代码来源:UserGroupsGrid.ascx.cs
示例10: SqlDataSource1_Deleted
protected void SqlDataSource1_Deleted(object sender, SqlDataSourceStatusEventArgs e)
{
if(e.Exception != null)
{
LabelErreur.Text = "Vous ne pouvez pas supprimer ce champs car il est en commande!";
e.ExceptionHandled = true;
}
}
开发者ID:boule46,项目名称:activite_git,代码行数:8,代码来源:AmeliorerPresentation.aspx.cs
示例11: SqlDataSource1_Selected
protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e)
{
if (e.AffectedRows == 0)
{
this.lblGames.Visible = true;
this.Wizard1.Enabled = false;
}
}
开发者ID:shaileshgajula,项目名称:c8a5b00a-1d86-40ff-a172-35d865eeec09,代码行数:8,代码来源:TournamentBuilder.aspx.cs
示例12: SqlDataSource1_Selected
protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e)
{
if (e.AffectedRows == 0)
{
this.lblTeam.Visible = false;
this.ddlTeams.Visible = false;
}
}
开发者ID:shaileshgajula,项目名称:c8a5b00a-1d86-40ff-a172-35d865eeec09,代码行数:8,代码来源:PlayerSubscription.aspx.cs
示例13: Selected
protected void Selected(object sender, SqlDataSourceStatusEventArgs e)
{
int n = e.AffectedRows;
if (n > 0)
Label2.Text = string.Format("Numero de Registos {0}", n);
else
Label2.Text = "Não existem Registos ";
return;
}
开发者ID:pedromonteiro,项目名称:PW-Projecto,代码行数:9,代码来源:GestaoAlunos.aspx.cs
示例14: SqlDataSource1_Deleted
protected void SqlDataSource1_Deleted(object sender, SqlDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
//ADMIN CANNOT DELETE
lblError.Text = "YOU CANNOT DELETE USER, ALREADY IN USE!";
e.ExceptionHandled = true;
}
}
开发者ID:ralbier,项目名称:SD20OnlineExamRevised,代码行数:9,代码来源:UserInformation.aspx.cs
示例15: SqlDataSource1_Deleted
protected void SqlDataSource1_Deleted(object sender, SqlDataSourceStatusEventArgs e)
{
//if (e.Exception != null)
//{
// //ADMIN CANNOT DELETE
// lblError1.Text = "YOU CANNOT DELETE QUESTION, ALREADY IN USE!";
// e.ExceptionHandled = true;
//}
}
开发者ID:ralbier,项目名称:SD20OnlineExamRevised,代码行数:9,代码来源:UpdateDelete.aspx.cs
示例16: FailMessagesSqlDataSource_Selected
protected void FailMessagesSqlDataSource_Selected(object sender, SqlDataSourceStatusEventArgs e)
{
//if (DataList1.Items.Count > 0)
//{
// panelFailMessages.Visible = true;
//}
//else
//{
// panelFailMessages.Visible = false;
//}
}
开发者ID:joelzeal,项目名称:loans-web-application,代码行数:11,代码来源:AppliedFeaturesComplete.aspx.cs
示例17: CheckForExceptions
/*
* Method that checks for exceptions, and handles them, when the SqlDataSource's Inserted, Updated, Selected and Deleted
* events are raised.
*/
protected void CheckForExceptions(object sender, SqlDataSourceStatusEventArgs e)
{
//Check if there's an exception
if (e.Exception != null)
{
MessagePanel.Visible = true;
Message.Text = e.Exception.Message;
e.ExceptionHandled = true;
}
}
开发者ID:ToreB,项目名称:pj600,代码行数:15,代码来源:ManageSLAProjects.aspx.cs
示例18: SqlDataSource1_Selected
protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
// Замаскировать ошибку общим сообщением
LabelError.Text = "Запрос не выполнен";
// Предположить, что ошибка обработана
e.ExceptionHandled = true;
}
}
开发者ID:ShartepStudy,项目名称:WPF,代码行数:11,代码来源:SqlDataSource.aspx.cs
示例19: CheckLogin
protected void CheckLogin(object sender, SqlDataSourceStatusEventArgs e)
{
if (e.AffectedRows > 0)
{
FormsAuthentication.RedirectFromLoginPage(Logintool.UserName,false);
Session["user"] = Logintool.UserName;
}
else
{
Logintool.FailureText = "Invalid Login";
}
}
开发者ID:helloocc,项目名称:destination,代码行数:13,代码来源:Login.aspx.cs
示例20: SqlDataSourceTipoEquip_Inserted
protected void SqlDataSourceTipoEquip_Inserted(object sender, SqlDataSourceStatusEventArgs e)
{
try
{
Response.Redirect("/Patrimonio/Equipamento.aspx?Id=" + e.Command.Parameters["@RETURN_VALUE"].Value.ToString());
}
catch (Exception)
{
throw;
}
}
开发者ID:Eriksonlove,项目名称:Touro,代码行数:13,代码来源:CadastrarEquipamento.aspx.cs
注:本文中的System.Web.UI.WebControls.SqlDataSourceStatusEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论