Search Results

Search found 1486 results on 60 pages for 'triggers'.

Page 1/60 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • WPF - Setting usercontrol width using triggers and mouseenter event

    - by BigBadJock
    I have a wrap panel full of usercontrols. When I hover the mouse over a usercontrol I want it to expand to show more details. Some stripped down sample code: <UserControl x:Class="WPFTestBed.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300" Width="300"> <UserControl.Resources> </UserControl.Resources> <UserControl.Triggers> <EventTrigger RoutedEvent="Mouse.MouseEnter"> <EventTrigger.Actions> <Setter TargetName="WPFTestBed.UserControl1" Property="Control.Width" Value="200"/> </EventTrigger.Actions> </EventTrigger> </UserControl.Triggers> <Grid Height="95" Width="123"> <Button Height="23" HorizontalAlignment="Left" Margin="17,30,0,0" Name="button1" VerticalAlignment="Top" Width="75">Button</Button> </Grid> </UserControl> I would appreciate it if someone could point out where I'm going wrong, and set me down the correct path. Ideally, I want the usercontrol to delay for x seconds when there is a mouseover, before expanding and showing the extra details.

    Read the article

  • help with mysql triggers (checking values before insert)

    - by user332817
    hi I'm quite new to mysql and I'm trying to figure out how to use triggers. what I'm trying to do: I have 2 tables, max and sub_max, when I insert a new row to sub_max I want to check if the SUM of the values with the same foreign_key as the new row are less than the value in the max table. I think this sounds confusing so here are my tables: CREATE TABLE max( number INT , MaxAmount integer NOT NULL) CREATE TABLE sub_max( sub_number INT , sub_MaxAmount integer NOT NULL, number INT, FOREIGN KEY ( number ) REFERENCES max( number )) and here is my code for the trigger, I know the syntax is off but this is the best I could do from looking up tutorials. CREATE TRIGGER maxallowed after insert on submax FOR EACH ROW BEGIN DECLARE submax integer; DECLARE maxmax integer; submax = select sum(sub_MaxAmount) from sub_max where sub_number = new.sub_number; submax = submax + new. sub_MaxAmount; maxmax = select MaxAmount from max where number = new.number ; if max>maxmax rollback? END I wanted to know if I'm doing this remotely correctly. Thanks in advance.

    Read the article

  • JDBC Triggers

    - by Tim Dexter
    Received a question from a customer last week, they were using the new rollup patch on top of 10.1.3.4.1. What are these boxes for? Don't you know? Surely? Well, they are for ... that new functionality, you know it's in the user docs, that thingmabobby doodah. OK, I dont know either, I can have a guess but let me check first. Serveral IM sessions, emails and a dig through the readme for the new patch and I had my answer. Its not in the official documentation, yet. Leslie is on the case. The two fields were designed to allow an Admin to set a users context attributes before a connection is made to a database and for un-setting the attributes after the connection is broken by the extraction engine. We got a sample from the Enterprise Manager team on how they will be using it with their VPD connections. FUNCTION bip_to_em_user (user_name_in IN VARCHAR2) RETURN BOOLEAN IS BEGIN SETEMUSERCONTEXT(user_name_in, MGMT_USER.OP_SET_IDENTIFIER); return TRUE; END bip_to_em_user; And used in the jdbc data source definition like this (pre-process function): sysman.mgmt_bip.bip_to_em_user(:xdo_user_name) You, of course can call any function that is going to return a boolean value, another example might be. FUNCTION set_per_process_username (username_in IN VARCHAR2) RETURN BOOLEAN IS BEGIN SETUSERCONTEXT(username_in); return TRUE; END set_per_process_username Just use your own function/package to set some user context. Very grateful for the mail from Leslie on the EM team's usage but I had to try it out. Rather than set up a VPD, I opted for a simpler test. Can I log the comings and goings of users and their queries using the same pre-process text box. Reaching back into the depths of my developer brain to remember some pl/sql, it was not that deep and I came up with: CREATE OR REPLACE FUNCTION BIPTEST (user_name_in IN VARCHAR2, smode IN VARCHAR2) RETURN BOOLEAN AS BEGIN INSERT INTO LOGTAB VALUES(user_name_in, sysdate,smode); RETURN true; END BIPTEST; To call it in the pre-fetch trigger. BIPTEST(:xdo_user_name) Not going to set the pl/sql world alight I know, but you get the idea. As a new connection is made to the database its logged in the LOGTAB table. The SMODE value just sets if its an entry or an exit. I used the pre- and post- boxes. NAME UPDATE_DATE S_FLAG oracle 14-MAY-10 09.51.34.000000000 AM Start oracle 14-MAY-10 10.23.57.000000000 AM Finish administrator 14-MAY-10 09.51.38.000000000 AM Start administrator 14-MAY-10 09.51.38.000000000 AM Finish oracle 14-MAY-10 09.51.42.000000000 AM Start oracle 14-MAY-10 09.51.42.000000000 AM Finish It works very well, I had some fun trying to find a nasty query for the extraction engine so that the timestamps from in to out actually had a difference. That engine is fast! The only derived value you can pass from BIP is :xdo_user_name. None of the other server values are available. Connection pools are not currently supported but planned for a future release. Now you know what those fields are for and look for some official documentation, rather than my ramblings, coming soon!

    Read the article

  • WPF reference style in resource dictionary and use triggers

    - by Taylor
    I have a style defined in a resource dictionary that applies to all ComboBox controls. Within the ComboBox control, I reference the style like so: Style="{DynamicResource MyComboBoxStyle}" This works ok. I want to be able to add some triggers to some of the ComboBox controls. What is a good way to use the style referenced as a dynamic resource yet still be able to add triggers to some of the ComboBox controls?

    Read the article

  • Best way to convert wpf triggers to silverlight?

    - by Stewart Armbrecht
    I have developed several custom controls in a wpf application that use triggers. what is the fastest way to convert the code so that I have a single code base that works both in the wpf application and the silverlight applicaiton. Here is a sample of the code: <Style x:Key="sButtonAction" TargetType="Button"> <!--<Setter Property="BitmapEffect" Value="{StaticResource BannerEffect}" />--> <Setter Property="Height" Value="25" /> <Setter Property="Margin" Value="4" /> <Setter Property="Cursor" Value="Hand" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Border x:Name="PART_Border" CornerRadius="10" BorderThickness="{StaticResource sBorderThicknessStandard}" BorderBrush="{StaticResource bColorBorder}" Background="{StaticResource ButtonActionBackground}"> <TextBlock x:Name="PART_TextBlock" Margin="5,2,5,2" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"> <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /></TextBlock> </Border> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter TargetName="PART_TextBlock" Property="Foreground" Value="#990000"></Setter> </Trigger> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="PART_Border" Property="Background" Value="{StaticResource ButtonActionBackgroundSelected}"></Setter> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>

    Read the article

  • Are database triggers evil?

    - by WW
    Are database triggers a bad idea? In my experience they are evil, because they can result in surprising side effects, and are difficult to debug (especially when one trigger fires another). Often developers do not even think of looking if there is a trigger. On the other hand, it seems like if you have logic that must occur evertime a new FOO is created in the database then the most foolproof place to put it is an insert trigger on the FOO table. The only time we're using triggers is for really simple things like setting the ModifiedDate.

    Read the article

  • TooManyRowsAffectedException with encrypted triggers

    - by Jon Masters
    I'm using nHibernate to update 2 columns in a table that has 3 encrypted triggers on it. The triggers are not owned by me and I can not make changes to them, so unfortunately I can't SET NOCOUNT ON inside of them. Is there another way to get around the TooManyRowsAffectedException that is thrown on commit? Update 1 So far only way I've gotten around the issue is to step around the .Save routine with var query = session.CreateSQLQuery("update Orders set Notes = :Notes, Status = :Status where OrderId = :Order"); query.SetString("Notes", orderHeader.Notes); query.SetString("Status", orderHeader.OrderStatus); query.SetInt32("Order", orderHeader.OrderHeaderId); query.ExecuteUpdate(); It feels dirty and is not easily to extend, but it doesn't crater.

    Read the article

  • Introduction to Google Apps Script Triggers

    Introduction to Google Apps Script Triggers Love Apps Script, but wish that it would just automatically work in the background? We've got just the thing for you - Triggers! This show will be an introductory level show about how to set up Apps Script so your scripts are run on a schedule, or in response to certain events like a spreadsheet being edited or a form submission. We'll talk about what triggers are, how to manually schedule triggers, how to programmatically create them, and some of the cool things you can do with them. From: GoogleDevelopers Views: 87 13 ratings Time: 50:17 More in Science & Technology

    Read the article

  • Using triggers to update linked server table

    - by tabouakl
    Can I use triggers to insert or update tables in a linked server? I tried it and got the following error: Unable to start a nested transaction for OLE DB provider 'SQLOLEDB'. A nested transaction was required because the XACT_ABORT option was set to OFF. [OLE/DB provider returned message: Cannot start more transactions on this session.] OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionLocal::StartTransaction returned 0x8004d013: ISOLEVEL=4096].

    Read the article

  • Question regarding WPF triggers

    - by Zoliq
    Hi, I have a problem with WPF triggers. In my application i used a multitrigger but would like to achieve that changes made when a trigger's conditions becomes true to persist and to be invalidated when the trigger's conditions become false. Is it possible to realize what I want ? Thanks in advance.

    Read the article

  • Problem importing mysql triggers generated from mysqldump

    - by OM The Eternity
    I am using phpmyadmin for using the mysqldump query, but as per my requirement i have to create a new database which is clone of the previous one, now in this case when i import the main DB it contain all the trigger information as well with the DB name mentioned in it.. As i import this DB to new one my triggers get imported as well but the trigger_schema are not changed as per new DB.. What could be done to get resolve this problem?

    Read the article

  • DataTemplate, Style, Triggers

    - by plotnick
    Could you guys help me? I have a with custom and in it: <ListBox> <ListBox.ItemTemplate> <DataTemplate> <Border BorderBrush="Black" BorderThickness="2" CornerRadius="5"> <Image Source="{Binding Picture}" /> </Border> </DataTemplate> </ListBox.ItemTemplate> </ListBox> Now when I'm choosing the ListBoxItem it gets ugly with blue colored row selection. I'd like to change it. I want to color only border's background and nothing else. Also I want to change OnMouseOver behavior. I've tried trough triggers, but ContentPresenter doesn't have Background property. help me pls.

    Read the article

  • FakeTable with tSQLt remove triggers

    - by user1454695
    I have jsut started to use tSQLt and is about to test a trigger. I call the FakeTable procedure and do my test but the trigger is not executed. If don't use FakeTable the trigger is executed. That seems to be really bad and I canät find any info that there is any method to readded them. Then I thought the triggers are removed by FakeTable but I can recreate them after the call and did the following code in my test: DECLARE @createTrigger NVARCHAR(MAX); SELECT @createTrigger = OBJECT_DEFINITION(OBJECT_ID('MoveDataFromAToB')) EXEC tSQLt.FakeTable 'dbo.A'; EXEC(@createTrigger); I got the following error: "There is already an object named 'MoveDataFromAToB' in the database.{MoveDataFromAToB,14} (There was also a ROLLBACK ERROR -- The current transaction cannot be committed and cannot be rolled back to a savepoint. Roll back the entire transaction.{Private_RunTest,60})" Anyone that have any experience with tSQLt and know anyworkaround for this problem?

    Read the article

  • Using TSQLUnit to test INSTEAD OF triggers

    - by Jeff Jones
    I have an INSTEAD OF trigger on a table in my SQL Server 2005 database that checks several incoming values. If an incoming value is invalid, an error is raised and the transaction is rolled back. Otherwise the record is inserted. I would like to include a TSQLUnit test of this trigger where, if an invalid value is inserted, having the transaction rolled back is the successful outcome of the test. I have created a test procedure to do this, but rolling back the transaction aborts execution of the whole suite of tests. Has anyone had success with this? If so, how did you accomplish it? If this is not possible with TSQLUnit, how do you test your triggers? Or do you test them at all?

    Read the article

  • triggers for generating userID based on user's information.

    - by nectar
    I have complaint table 1. tblProfile with columns userId | name | age | address | mobileno | 2. tblUserId with columns userId | role | status now when user fills the form I want to insert one row in tblProfile, before inserting a new row I want to create userId by combining starting letters of name and mobile no and then insert into tblprofile with userId after this I want to insert that UserId into tblUserId table. for this I have to use two triggers one is before insert trigger and another is after insert trigger.but I dont know how to capture user information to create userId and how to pass that Id to second trigger.

    Read the article

  • Database triggers / referential integrity and in-memory caching

    - by Ran Biron
    Do you see database triggers / referential integrity rules being used in a way that changes actual data in the database (changing row w in table x causes a change in row y in table z)? If yes, How does this tie-in with the increasing popularity of in-memory caching (memcache and friends)? After all, these actions occur inside the database but the caching system must be aware of them in order to reflect to correct state (or at least invalidate the possibly changed state). I find it hard to believe that callbacks are implemented for such cases. Does anyone have real-world experience with such a setup / real-world experience with considering such a setup and abandoning it (which way did you go? if caching, how do you enforce integrity?)

    Read the article

  • How to group data changes by operation with MySQL triggers

    - by Jan-Henk
    I am using triggers in MySQL to log changes to the data. These changes are recorded on a row level. I can now insert an entry in my log table for each row that is changed. However, I also need to record the operation to which the changes belong. For example, a delete operation like "DELETE * FROM table WHERE type=x" can delete multiple rows. With the trigger I can insert an entry for each deleted row into the log table, but I would like to also provide a unique identifier for the operation as a whole, so that the log table looks something like: log_id operation_id tablename fieldname oldvalue newvalue 1 1 table id 1 null 2 1 table type a null 3 1 table id 2 null 4 1 table type a null 5 2 table id 3 null 6 2 table type b null 7 2 table id 4 null 8 2 table type b null Is there a way in MySQL to identify the higher level operation to which the row changes belong? Or is this only possible by means of application level code? In the future it would also be nice to be able to record the transaction to which an operation belongs. Another question is if it is possible to capture the actual SQL query, besides using the query log. I don't think so myself, but maybe I am missing something. It is of course possible to capture these at the application level, but the goal is to keep intrusions to the application level code as minimal as possible. When this is not possible with MySQL, how is this with other database systems? For the current project it is not an option to use something other than MySQL, but it would be nice to know for future projects.

    Read the article

  • Mysql dropping inserts with triggers

    - by user2891127
    Using mysql 5.5. I have two tables. One has a whitelist of hashes. When I insert a new row into the other table, I want to first compare the hash in the insert statement to the whitelist. If it's in the whitelist, I don't want to do the insert (less data to plow through later). The inserts are generated from another program and are text files with sql statements. I've been playing with triggers, and almost have it working: BEGIN IF (select count(md5hash) from whitelist where md5hash=new.md5hash) 0 THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Already Whitelisted'; END IF; END But there's a problem. The Signal throwing up the error stops the import. I want to skip that line, not stop the whole import. Some searching didn't find any way to silently skip the import. My next idea was to create a duplicate table definition, and redirect the insert to that dup table. But the old and new don't seem to apply to table names. Other then adding an ignore column to my table then doing a mass drop based on that column after the import, is there any way to achieve my goal?

    Read the article

  • EF4: ObjectContext inconsistent when inserting into a view with triggers

    - by user613567
    I get an Invalid Operation Exception when inserting records in a View that uses “Instead of” triggers in SQL Server with ADO.NET Entity Framework 4. The error message says: {"The changes to the database were committed successfully, but an error occurred while updating the object context. The ObjectContext might be in an inconsistent state. Inner exception message: The key-value pairs that define an EntityKey cannot be null or empty. Parameter name: record"} @ at System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options) at System.Data.Objects.ObjectContext.SaveChanges() In this simplified example I created two tables, Contacts and Employers, and one view Contacts_x_Employers which allows me to insert or retrieve rows into/from these two tables at once. The Tables only have a Name and an ID attributes and the view is based on a join of both: CREATE VIEW [dbo].[Contacts_x_Employers] AS SELECT dbo.Contacts.ContactName, dbo.Employers.EmployerName FROM dbo.Contacts INNER JOIN dbo.Employers ON dbo.Contacts.EmployerID = dbo.Employers.EmployerID And has this trigger: Create TRIGGER C_x_E_Inserts ON Contacts_x_Employers INSTEAD of INSERT AS BEGIN SET NOCOUNT ON; insert into Employers (EmployerName) select i.EmployerName from inserted i where not i.EmployerName in (select EmployerName from Employers) insert into Contacts (ContactName, EmployerID) select i.ContactName, e.EmployerID from inserted i inner join employers e on i.EmployerName = e.EmployerName; END GO The .NET Code follows: using (var Context = new TriggersTestEntities()) { Contacts_x_Employers CE1 = new Contacts_x_Employers(); CE1.ContactName = "J"; CE1.EmployerName = "T"; Contacts_x_Employers CE2 = new Contacts_x_Employers(); CE1.ContactName = "W"; CE1.EmployerName = "C"; Context.Contacts_x_Employers.AddObject(CE1); Context.Contacts_x_Employers.AddObject(CE2); Context.SaveChanges(); //? line with error } SSDL and CSDL (the view nodes): <EntityType Name="Contacts_x_Employers"> <Key> <PropertyRef Name="ContactName" /> <PropertyRef Name="EmployerName" /> </Key> <Property Name="ContactName" Type="varchar" Nullable="false" MaxLength="50" /> <Property Name="EmployerName" Type="varchar" Nullable="false" MaxLength="50" /> </EntityType> <EntityType Name="Contacts_x_Employers"> <Key> <PropertyRef Name="ContactName" /> <PropertyRef Name="EmployerName" /> </Key> <Property Name="ContactName" Type="String" Nullable="false" MaxLength="50" Unicode="false" FixedLength="false" /> <Property Name="EmployerName" Type="String" Nullable="false" MaxLength="50" Unicode="false" FixedLength="false" /> </EntityType> The Visual Studio solution and the SQL Scripts to re-create the whole application can be found in the TestViewTrggers.zip at ftp://JulioSantos.com/files/TriggerBug/. I appreciate any assistance that can be provided. I already spent days working on this problem.

    Read the article

  • PostgreSQL triggers and passing parameters

    - by iandouglas
    This is a multi-part question. I have a table similar to this: CREATE TABLE sales_data ( Company character(50), Contract character(50), top_revenue_sum integer, top_revenue_sales integer, last_sale timestamp) ; I'd like to create a trigger for new inserts into this table, something like this: CREATE OR REPLACE FUNCTION add_contract() RETURNS VOID DECLARE myCompany character(50), myContract character(50), BEGIN myCompany = TG_ARGV[0]; myContract = TG_ARGV[1]; IF (TG_OP = 'INSERT') THEN EXECUTE 'CREATE TABLE salesdata_' || $myCompany || '_' || $myContract || ' ( sale_amount integer, updated TIMESTAMP not null, some_data varchar(32), country varchar(2) ) ;' EXECUTE 'CREATE TRIGGER update_sales_data BEFORE INSERT OR DELETE ON salesdata_' || $myCompany || '_' || $myContract || ' FOR EACH ROW EXECUTE update_sales_data( ' || $myCompany || ',' || $myContract || ', revenue);' ; END IF; END; $add_contract$ LANGUAGE plpgsql; CREATE TRIGGER add_contract AFTER INSERT ON sales_data FOR EACH ROW EXECUTE add_contract() ; Basically, every time I insert a new row into sales_data, I want to generate a new table where the name of the table will be defined as something like "salesdata_Company_Contract" So my first question is how can I pass the Company and Contract data to the trigger so it can be passed to the add_contract() stored procedure? From my stored procedure, you'll see that I also want to update the original sales_data table whenever new data is inserted into the salesdata_Company_Contract table. This trigger will do something like this: CREATE OR REPLACE FUNCTION update_sales_data() RETURNS trigger as $update_sales_data$ DECLARE myCompany character(50) NOT NULL, myContract character(50) NOT NULL, myRevenue integer NOT NULL BEGIN myCompany = TG_ARGV[0] ; myContract = TG_ARGV[1] ; myRevenue = TG_ARGV[2] ; IF (TG_OP = 'INSERT') THEN UPDATE sales_data SET top_revenue_sales = top_revenue_sales + 1, top_revenue_sum = top_revenue_sum + $myRevenue, updated = now() WHERE Company = $myCompany AND Contract = $myContract ; ELSIF (TG_OP = 'DELETE') THEN UPDATE sales_data SET top_revenue_sales = top_revenue_sales - 1, top_revenue_sum = top_revenue_sum - $myRevenue, updated = now() WHERE Company = $myCompany AND Contract = $myContract ; END IF; END; $update_sales_data$ LANGUAGE plpgsql; This will, of course, require that I pass several parameters around within these stored procedures and triggers, and I'm not sure (a) if this is even possible, or (b) practical, or (c) best practice and we should just put this logic into our other software instead of asking the database to do this work for us. To keep our table sizes down, as we'll have hundreds of thousands of transactions per day, we've decided to partition our data using the Company and Contract strings as part of the table names themselves so they're all very small in size; file IO for us is faster and we felt we'd get better performance. Thanks for any thoughts or direction. My thinking, now that I've written all of this out, is that maybe we need to write stored procedures where we pass our insert data as parameters, and call that from our other software, and have the stored procedure do the insert into "sales_data" then create the other table. Then, have a second stored procedure to insert new data into the salesdata_Company_Contract tables, where the table name is passed to the stored proc as a parameter, and again have that stored proc do the insert, then update the main sales_data table afterward. What approach would you take?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >