當前位置: 首頁>>代碼示例>>C#>>正文


C# WebControls.SqlDataSourceStatusEventArgs類代碼示例

本文整理匯總了C#中System.Web.UI.WebControls.SqlDataSourceStatusEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# SqlDataSourceStatusEventArgs類的具體用法?C# SqlDataSourceStatusEventArgs怎麽用?C# SqlDataSourceStatusEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SqlDataSourceStatusEventArgs類屬於System.Web.UI.WebControls命名空間,在下文中一共展示了SqlDataSourceStatusEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的System.Web.UI.WebControls.SqlDataSourceStatusEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。