Search Results

Search found 4873 results on 195 pages for 'jeremy child'.

Page 20/195 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Close child form if already open

    - by j-t-s
    Hi All How can I go about closing a Child form if it's already open? And if it isn't already open, then open it? Thank you I already have this code, which doesn't work, obviously: Form ibx = new inbox(); if(ibx.Visible) ibx.Dispose(); else ibx.Show(); All that the above does is creates a new form whether or not it's already open.

    Read the article

  • extjs how to make a nested child using xTemplate when we don't know how deep is it?

    - by Ebo the gordon
    first, sorry if my english bad,.... in my script, variable tplData below is dynamic,... (lets say it generates from database) so, every chid, can have another child. and so on,.... now, i'm stack how to iteration it,.. var tplData = [{ name : 'Naomi White' },{ name : 'Yoko Ono' },{ name : 'John Smith', child : [{ name:'Michael (John\'s son)', child: [{ name : 'Brad (Michael\'s son,John\'s grand son)' },{ name : 'Brid (Michael\'s son,John\'s grand son)', child: [{ name:'Buddy (Brid\'s son,Michael\'s grand son)' }] },{ name : 'Brud (Michael\'s son,John\'s grand son)' }] }] }]; var myTpl = new Ext.XTemplate( '<tpl for=".">', '<div style="background-color: {color}; margin: 10px;">', '<b> Name :</b> {name}<br />', // how to make this over and over every child (while it has ) '<tpl if="typeof child !=\'undefined\'">', '<b> Child : </b>', '<tpl for="child">', '{name} <br />', '</tpl>', '</tpl>', /////////////////////////////////////// '</div>', '</tpl>' ); myTpl.compile(); myTpl.overwrite(document.body, tplData);

    Read the article

  • When calling a static method on parent class, can the parent class deduce the type on the child (C#)

    - by Matt
    Suppose we have 2 classes, Child, and the class from which it inherits, Parent. class Parent { public static void MyFunction(){} } class Child : Parent { } Is it possible to determine in the parent class how the method was called? Because we can call it two ways: Parent.MyFunction(); Child.MyFunction(); My current approach was trying to use: MethodInfo.GetCurrentMethod().ReflectedType; // and MethodInfo.GetCurrentMethod().DeclaringType; But both appear to return the Parent type. If you are wondering what, exactly I am trying to accomplish (and why I am violating the basic OOP rule that the parent shouldn't have to know anything about the child), the short of it is this (let me know if you want the long version): I have a Model structure representing some of our data that persists to the database. All of these models inherit from an abstract Parent. This parent implements a couple of events, such as SaveEvent, DeleteEvent, etc. We want to be able to subscribe to events specific to the type. So, even though the event is in the parent, I want to be able to do: Child.SaveEvent += new EventHandler((sender, args) => {}); I have everything in place, where the event is actually backed by a dictionary of event handlers, hashed by type. The last thing I need to get working is correctly detecting the Child type, when doing Child.SaveEvent. I know I can implement the event in each child class (even forcing it through use of abstract), but it would be nice to keep it all in the parent, which is the class actually firing the events (since it implements the common save/delete/change functionality).

    Read the article

  • ASP.NET MVC 2 - Saving child entities on form submit

    - by Justin
    Hey, I'm using ASP.NET MVC 2 and am struggling with saving child entities. I have an existing Invoice entity (which I create on a separate form) and then I have a LogHours view that I'd like to use to save InvoiceLog's, which are child entities of Invoice. Here's the view: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TothSolutions.Data.Invoice>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Log Hours </asp:Content> <asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server"> <script type="text/javascript"> $(document).ready(function () { $("#InvoiceLogs_0__Description").focus(); }); </script> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Log Hours</h2> <% using (Html.BeginForm("SaveHours", "Invoices")) {%> <%: Html.ValidationSummary(true) %> <fieldset> <legend>Fields</legend> <table> <tr> <th>Date</th> <th>Description</th> <th>Hours</th> </tr> <% int index = 0; foreach (var log in Model.InvoiceLogs) { %> <tr> <td><%: log.LogDate.ToShortDateString() %></td> <td><%: Html.TextBox("InvoiceLogs[" + index + "].Description")%></td> <td><%: Html.TextBox("InvoiceLogs[" + index + "].Hours")%></td> <td>Hours</td> </tr> <% index++; } %> </table> <p> <%: Html.Hidden("InvoiceID") %> <%: Html.Hidden("CreateDate") %> <input type="submit" value="Save" /> </p> </fieldset> <% } %> <div> <%: Html.ActionLink("Back to List", "Index") %> </div> </asp:Content> And here's the controller code: //GET: /Secure/Invoices/LogHours/ public ActionResult LogHours(int id) { var invoice = DataContext.InvoiceData.Get(id); if (invoice == null) { throw new Exception("Invoice not found with id: " + id); } return View(invoice); } //POST: /Secure/Invoices/SaveHours/ [AcceptVerbs(HttpVerbs.Post)] public ActionResult SaveHours([Bind(Exclude = "InvoiceLogs")]Invoice invoice) { TryUpdateModel(invoice.InvoiceLogs, "InvoiceLogs"); invoice.UpdateDate = DateTime.Now; invoice.DeveloperID = DeveloperID; //attaching existing invoice. DataContext.InvoiceData.Attach(invoice); //save changes. DataContext.SaveChanges(); //redirect to invoice list. return RedirectToAction("Index"); } And the data access code: public static void Attach(Invoice invoice) { var i = new Invoice { InvoiceID = invoice.InvoiceID }; db.Invoices.Attach(i); db.Invoices.ApplyCurrentValues(invoice); } In the SaveHours action, it properly sets the values of the InvoiceLog entities after I call TryUpdateModel but when it does SaveChanges it doesn't update the database with the new values. Also, if you manually update the values of the InvoiceLog entries in the database and then go to this page it doesn't populate the textboxes so it's clearly not binding correctly. Thanks, Justin

    Read the article

  • php-fpm version 5.4 with nginx constantly restarting

    - by endyourif
    I just upgraded my php version from 5.3.x to 5.4.x and since doing this - memory has dropped signifincantly! - however, I'm constantly getting these in my php5-fpm.log: [18-Sep-2012 15:11:34] WARNING: [pool www] child 8981 exited on signal 11 (SIGSEGV - core dumped) after 65.813370 seconds from start [18-Sep-2012 15:11:34] NOTICE: [pool www] child 8988 started [18-Sep-2012 15:12:09] WARNING: [pool www] child 8988 exited on signal 11 (SIGSEGV - core dumped) after 35.185071 seconds from start [18-Sep-2012 15:12:09] NOTICE: [pool www] child 8990 started [18-Sep-2012 15:12:17] WARNING: [pool www] child 8990 exited on signal 11 (SIGSEGV - core dumped) after 8.277977 seconds from start [18-Sep-2012 15:12:17] NOTICE: [pool www] child 8992 started [18-Sep-2012 15:12:18] WARNING: [pool www] child 8982 exited on signal 11 (SIGSEGV - core dumped) after 109.550089 seconds from start [18-Sep-2012 15:12:18] NOTICE: [pool www] child 8995 started [18-Sep-2012 15:12:18] WARNING: [pool www] child 8985 exited on signal 11 (SIGSEGV - core dumped) after 109.668554 seconds from start [18-Sep-2012 15:12:18] NOTICE: [pool www] child 8996 started From what I can gather this is php silently dying? I'm running basic Wordpress sites that keep popping up with 502 errors while php-fpm is constantly spinning up new processes.

    Read the article

  • My hosting server giving memory allocation error

    - by Usman
    I have hosted my website on shared hosting linux server. As there are atmost 10-15 visitors come to my website daily but My wordpress website most of the times gives 500 Internal Server Error. I accessed my server Error Log following error is showing: [Tue Dec 04 08:57:45 2012] [error] [client 117.205.74.227] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/grasphub/public_html/index.php [Tue Dec 04 08:57:45 2012] [error] [client 117.205.74.227] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/grasphub/public_html/index.php [Tue Dec 04 08:57:43 2012] [error] [client 117.205.74.227] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/grasphub/public_html/index.php [Tue Dec 04 08:57:43 2012] [error] [client 117.205.74.227] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/grasphub/public_html/index.php [Tue Dec 04 08:57:42 2012] [error] [client 117.205.74.227] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/grasphub/public_html/index.php [Tue Dec 04 08:57:42 2012] [error] [client 117.205.74.227] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/grasphub/public_html/index.php [Tue Dec 04 08:57:41 2012] [error] [client 117.205.74.227] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/grasphub/public_html/index.php [Tue Dec 04 08:57:41 2012] [error] [client 117.205.74.227] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/grasphub/public_html/index.php [Tue Dec 04 08:57:40 2012] [error] [client 117.205.74.227] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/grasphub/public_html/index.php [Tue Dec 04 08:57:40 2012] [error] [client 117.205.74.227] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/grasphub/public_html/index.php [Tue Dec 04 08:57:32 2012] [error] [client 117.205.74.227] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/grasphub/public_html/index.php [Tue Dec 04 08:57:31 2012] [error] [client 117.205.74.227] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/grasphub/public_html/index.php [Tue Dec 04 08:57:29 2012] [error] [client 117.205.74.227] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/grasphub/public_html/index.php [Tue Dec 04 08:57:29 2012] [error] [client 117.205.74.227] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/grasphub/public_html/index.php [Tue Dec 04 08:57:26 2012] [error] [client 117.205.74.227] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/grasphub/public_html/index.php Is my hosting service really bad. And any solution. Thanks in advance.

    Read the article

  • Can't save data for a member in a data form

    - by RahulS
    Implied sharing is an old thing everyone knows the reasons and solutions of that, still little theory about that: With Essbase implied sharing, some members are shared even if you do not explicitly set them as shared. These members are implied shared members. When an implied share relationship is created, each implied member assumes the other member’s value. Essbase assumes (or implies) a shared member relationship in these situations: 1. A parent has only one child 2. A parent has only one child that consolidates to the parent In a Planning form that contains members with an implied sharing relationship, when a value is added for the parent, the child assumes the same value after the form is saved. Likewise, if a value is added for the child, the parent usually assumes the same value after a form is saved.For example, when a calculation script or load rule populates an implied share member, the other implied share member assumes the value of the member populated by the calculation script or load rule. The last value calculated or imported takes precedence. The result is the same whether you refer to the parent or the child as a variable in a calculation script. For more information have a look at: http://docs.oracle.com/cd/E17236_01/epm.1112/hp_admin_11122/ch14s11.html Now the issue which we are going to talk about is We loose data on save even when the parent is dynamic calc and has a single child. A dynamic calc parent to a single child:  If we design the form with following selection: In the data form we will find parent below the member and this is by design whenever you make a selection using commands to select all the member below parent, always children will appear before the parent: Lets try to enter data, Save it Now, try to change the way we selected members Here we go: Now the question again why this behavior: 1. Data from Planning data form passes to Essbase row by row, 2. Because in data form the child member appears before the parent, 3. First, data goes to Essbase for child (SingleStoreChild), 4. Then when Planning passes the data for parent there was #Missing or No data,  5. Over writes the data to #missing. PS: As we know that dynamic calc members are calculated on the fly they are not allocated with any memory in the Essbase, here the parent was dynamic calc and it was pointing to same memory as child in the background, when Planning was passing data to Essbase for second row it has updated the child with missing data.(Little confusing, let me know if you need more explanation) 6. As one of the solutions just change the order of appearance of parent and child. Cheers..!!! Rahul S. https://www.facebook.com/pages/HyperionPlanning/117320818374228

    Read the article

  • SUM of metric for normalized logical hierarchy

    - by Alex254
    Suppose there's a following table Table1, describing parent-child relationship and metric: Parent | Child | Metric (of a child) ------------------------------------ name0 | name1 | a name0 | name2 | b name1 | name3 | c name2 | name4 | d name2 | name5 | e name3 | name6 | f Characteristics: 1) Child always has 1 and only 1 parent; 2) Parent can have multiple children (name2 has name4 and name5 as children); 3) Number of levels in this "hierarchy" and number of children for any given parent are arbitrary and do not depend on each other; I need SQL request that will return result set with each name and a sum of metric of all its descendants down to the bottom level plus itself, so for this example table the result would be (look carefully at name1): Name | Metric ------------------ name1 | a + c + f name2 | b + d + e name3 | c + f name4 | d name5 | e name6 | f (name0 is irrelevant and can be excluded). It should be ANSI or Teradata SQL. I got as far as a recursive query that can return a SUM (metric) of all descendants of a given name: WITH RECURSIVE temp_table (Child, metric) AS ( SELECT root.Child, root.metric FROM table1 root WHERE root.Child = 'name1' UNION ALL SELECT indirect.Child, indirect.metric FROM temp_table direct, table1 indirect WHERE direct.Child = indirect.Parent) SELECT SUM(metric) FROM temp_table; Is there a way to turn this query into a function that takes name as an argument and returns this sum, so it can be called like this? SELECT Sum_Of_Descendants (Child) FROM Table1; Any suggestions about how to approach this from a different angle would be appreciated as well, because even if the above way is implementable, it will be of poor performance - there would be a lot of iterations of reading metrics (value f would be read 3 times in this example). Ideally, the query should read a metric of each name only once.

    Read the article

  • bind parent child listview asp.net

    - by Chris
    I'm trying to display two linq query results in a prent and child listview. I have the following code which gets the correct values to populate the listviews but when I nest the child listview inside the parent list view, I get an error saying "The name 'ListView2' does not exist in the current context". I presume I need to bind the two listviews in the code behind but my problem is I don't know how or the best way to do this. I have read a couple of posts on similar problems but my lack of knowledge on the subject doesn't make it clear to me. Please can somebody help me figure this out? It's the final piece of code I need to complete. Many thanks in advance. Here is my .aspx code: <asp:ListView ID="ListView1" runat="server"> <EmptyDataTemplate>No data was returned.</EmptyDataTemplate> <ItemSeparatorTemplate><br /></ItemSeparatorTemplate> <ItemTemplate> <li> <asp:Label ID="LabelID" runat="server" Text='<%# Eval("RecordID") %>'></asp:Label><br /> <asp:Label ID="LabelNumber" runat="server" Text='<%# Eval("CartID") %>'></asp:Label><br /> <asp:Label ID="LabelName" runat="server" Text='<%# Eval("Number") %>'></asp:Label><br /> <asp:Label ID="LabelDestination" runat="server" Text='<%# Eval("Destination") %>'></asp:Label><br /> <asp:Label ID="LabelPkgName" runat="server" Text='<%# Eval("PkgName") %>'></asp:Label> <li> <!-- LIST VIEW FOR FEATURES --> <asp:ListView ID="ListView2" runat="server"> <EmptyDataTemplate>No data was returned.</EmptyDataTemplate> <ItemSeparatorTemplate><br /></ItemSeparatorTemplate> <ItemTemplate> <li> <asp:Label ID="LabelFeatureName" runat="server" Text='<%# Eval("FeatureName") %>'></asp:Label><br /> <asp:Label ID="LabelFeatureSetUp" runat="server" Text='<%# Eval("FeatureSetUp") %>'></asp:Label><br /> <asp:Label ID="LabelFeatureMonthly" runat="server" Text='<%# Eval("FeatureMonthly") %>'></asp:Label><br /> </li> </ItemTemplate> <LayoutTemplate> <ul ID="itemPlaceholderContainer" runat="server" style=""> <li runat="server" id="itemPlaceholder" /> </ul> </LayoutTemplate> </asp:ListView> <!-- LIST VIEW FOR FEATURES [END] --> </li> </li> </ItemTemplate> <LayoutTemplate> <ul ID="itemPlaceholderContainer" runat="server" style=""> <li runat="server" id="itemPlaceholder" /> </ul> </LayoutTemplate> </asp:ListView> Here is my code behind: MyShoppingCart userShoppingCart = new MyShoppingCart(); string cartID = userShoppingCart.GetShoppingCartId(); using (ShoppingCartv2Entities db = new ShoppingCartv2Entities()) { var CartNumber = from c in db.NewViews where c.CartID == cartID select c; foreach (NewView item in CartNumber) { ListView1.DataSource = CartNumber; ListView1.DataBind(); } var CartFeature = from f in db.NewViews join o in db.NumberFeatureViews on f.RecordID equals o.RecordID where f.CartID == cartID select new { o.FeatureName, o.FeatureSetUp, o.FeatureMonthly }; foreach (var x in CartFeature) { ListView2.DataSource = CartFeature; ListView2.DataBind(); } }

    Read the article

  • Please clarify how create/update happens against child entities of an aggregate root

    - by christian
    After much reading and thinking as I begin to get my head wrapped around DDD, I am a bit confused about the best practices for dealing with complex hierarchies under an aggregate root. I think this is a FAQ but after reading countless examples and discussions, no one is quite talking about the issue I'm seeing. If I am aligned with the DDD thinking, entities below the aggregate root should be immutable. This is the crux of my trouble, so if that isn't correct, that is why I'm lost. Here is a fabricated example...hope it holds enough water to discuss. Consider an automobile insurance policy (I'm not in insurance, but this matches the language I hear when on the phone w/ my insurance company). Policy is clearly an entity. Within the policy, let's say we have Auto. Auto, for the sake of this example, only exists within a policy (maybe you could transfer an Auto to another policy, so this is potential for an aggregate as well, which changes Policy...but assume it simpler than that for now). Since an Auto cannot exist without a Policy, I think it should be an Entity but not a root. So Policy in this case is an aggregate root. Now, to create a Policy, let's assume it has to have at least one auto. This is where I get frustrated. Assume Auto is fairly complex, including many fields and maybe a child for where it is garaged (a Location). If I understand correctly, a "create Policy" constructor/factory would have to take as input an Auto or be restricted via a builder to not be created without this Auto. And the Auto's creation, since it is an entity, can't be done beforehand (because it is immutable? maybe this is just an incorrect interpretation). So you don't get to say new Auto and then setX, setY, add(Z). If Auto is more than somewhat trivial, you end up having to build a huge hierarchy of builders and such to try to manage creating an Auto within the context of the Policy. One more twist to this is later, after the Policy is created and one wishes to add another Auto...or update an existing Auto. Clearly, the Policy controls this...fine...but Policy.addAuto() won't quite fly because one can't just pass in a new Auto (right!?). Examples say things like Policy.addAuto(VIN, make, model, etc.) but are all so simple that that looks reasonable. But if this factory method approach falls apart with too many parameters (the entire Auto interface, conceivably) I need a solution. From that point in my thinking, I'm realizing that having a transient reference to an entity is OK. So, maybe it is fine to have a entity created outside of its parent within the aggregate in a transient environment, so maybe it is OK to say something like: auto = AutoFactory.createAuto(); auto.setX auto.setY or if sticking to immutability, AutoBuilder.new().setX().setY().build() and then have it get sorted out when you say Policy.addAuto(auto) This insurance example gets more interesting if you add Events, such as an Accident with its PolicyReports or RepairEstimates...some value objects but most entities that are all really meaningless outside the policy...at least for my simple example. The lifecycle of Policy with its growing hierarchy over time seems the fundamental picture I must draw before really starting to dig in...and it is more the factory concept or how the child entities get built/attached to an aggregate root that I haven't seen a solid example of. I think I'm close. Hope this is clear and not just a repeat FAQ that has answers all over the place.

    Read the article

  • 'Element is already the child of another element' error in Silverlight App.xaml

    - by rwwilden
    Hi, I keep getting a strange error inside my App.xaml file: Element is already the child of another element. My App.xaml file looks like this: <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="Celerior.Annapurna.SL.App"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="ProvisiorResourceDictionary.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application> The error is reported for the entire ResourceDictionary element (from lines 5 to 9). ProvisiorResourceDictionary.xaml contains a number of styles and templates. Nothing exciting in my opinion. Does anyone know what is wrong? Kind regards, Ronald Wildenberg

    Read the article

  • the element 'transport' cannot contain child element 'extendedProtectionPolicy' because the parent e

    - by neildeadman
    I inherited a web application that makes calls to a web service. It is being developed in VS2008 SP1 and deployed to IIS6 (2k3 Server R2). Since I upgraded to Windows 7 Enterprise RTM, the following line gets added to my Web.config: <extendedProtectionPolicy policyEnforcement="Never" /> The problem is that when I deploy this application to my web server I get the following error: The element 'transport' cannot contain child element 'extendedProtectionPolicy' because the parent element's content model is empty I can remove the line and it will work, but its a pain and I forget sometimes to remove it again (VS2008 adds seems to add it back whenever I load the solution!!). Is there anything that can be done? Here is my 'transport' section: <transport clientCredentialType="None" proxyCredentialType="None" realm=""> <extendedProtectionPolicy policyEnforcement="Never" /> </transport> Thanks Neil

    Read the article

  • automation of data format conversion to parent child format

    - by silverkid
    This is an excel sheet which has only a single column filled for each row. (explanation : all CITY categories fall under V21 , all handset categories fall under CityJ and so on ) V21 CITYR CITYJ HandsetS HandsetHW HandsetHA LOWER_AGE<=20 LOWER_AGE>20 SMS_COUNT<=0 RECHARGE_MRP<=122 RECHARGE_MRP>122 SMS_COUNT>0 I need to change this format to a double column format with parent and child category format. therefore the output sheet would be V21 CITYR V21 CITYJ CITYJ HandsetS CITYJ HandsetHW CITYJ HandsetHA HandsetHA LOWER_AGE<=20 HandsetHA LOWER_AGE>20 LOWER_AGE>20 SMS_COUNT<=0 SMS_COUNT<=0 RECHARGE_MRP<=122 SMS_COUNT<=0 RECHARGE_MRP>122 LOWER_AGE>20 SMS_COUNT>0 the datas are huge so i cant do them manually . how can i automate this ?

    Read the article

  • Howto bind a RoutedCommand in a child?

    - by Wouter
    I am having trouble binding a Command that is generated up the UI tree to a control. The following example illustrates my point, the CommandBinding in Grid does not act on the InputBindings in Window. Maybe I do not understand the point of commands, but I would like to have a nice solution for child controls to act on user input on the Window (any control on the Window). <Window x:Class="SilverFit.Menu.Wpf.WpfWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Window.InputBindings> <KeyBinding Command="Close" Key="Escape"/> <MouseBinding Command="Close" MouseAction="RightClick" /> </Window.InputBindings> <Grid Name="grid"> <Grid.CommandBindings> <CommandBinding Command="Close" Executed="Close"/> </Grid.CommandBindings> </Grid> </Window>

    Read the article

  • Nested/Child TransactionScope Rollback

    - by Robert Wagner
    I am trying to nest TransactionScopes (.net 4.0) as you would nest Transactions in SQL Server, however it looks like they operate differently. I want my child transactions to be able to rollback if they fail, but allow the parent transaction to decide whether to commit/rollback the whole operation. A greatly simplified example of what I am trying to do: static void Main(string[] args) { using(var scope = new TransactionScope()) // Trn A { // Insert Data A DoWork(true); DoWork(false); // Rollback or Commit } } // This class is a few layers down static void DoWork(bool fail) { using(var scope = new TransactionScope()) // Trn B { // Update Data A if(!fail) { scope.Complete(); } } } I can't use the Suppress or RequiresNew options as Trn B relies on data inserted by Trn A. If I do use those options, Trn B is blocked by Trn A. Any ideas how I would get it to work, or if it is even possible using the System.Transactions namespace? Thanks

    Read the article

  • Hibernate: Parent/Child relationship in a single-table

    - by Dee
    I hardly see any pointer on the following problem related to Hibernate. This pertains to implementing inheritance using a single database table with a parent-child relationship to itself. For example: CREATE TABLE Employee ( empId BIGINT NOT NULL AUTO_INCREMENT, empName VARCHAR(100) NOT NULL, managerId BIGINT, CONSTRAINT pk_employee PRIMARY KEY (empId) ) Here, the managerId column may be null, or may point to another row of the Employee table. Business rule requires the Employee to know about all his reportees and for him to know about his/her manager. The business rules also allow rows to have null managerId (the CEO of the organisation doesn't have a manager). How do we map this relationship in Hibernate, standard many-to-one relationship doesn't work here? Example code would be appreciated.

    Read the article

  • Hibernate: Parent/Child relationship in a single-table

    - by Dee
    I hardly see any pointer on the following problem related to Hibernate. This pertains to implementing inheritance using a single database table with a parent-child relationship to itself. For example: CREATE TABLE Employee ( empId BIGINT NOT NULL AUTO_INCREMENT, empName VARCHAR(100) NOT NULL, managerId BIGINT, CONSTRAINT pk_employee PRIMARY KEY (empId) ) Here, the managerId column may be null, or may point to another row of the Employee table. Business rule requires the Employee to know about all his reportees and for him to know about his/her manager. The business rules also allow rows to have null managerId (the CEO of the organisation doesn't have a manager). How do we map this relationship in Hibernate, standard many-to-one relationship doesn't work here? Example code would be appreciated.

    Read the article

  • Send TAB to a child console (windows)

    - by alex2k8
    I create a child console application with _process = new Process(); _process.StartInfo.FileName = @"cmd.exe"; _process.StartInfo.UseShellExecute = false; _process.StartInfo.RedirectStandardInput = true; _process.StartInfo.RedirectStandardOutput = true; _process.StartInfo.CreateNoWindow = true; _proccess.Start(); Now I can go to c:\aaa _process.StandardInput.Write("cd c:\\aaa\xD\xA"); But normally user can type c:\ + TAB + ENTER. How can I do the same? This does not work: _process.StandardInput.Write("cd c:\\\0x9\xD\xA");

    Read the article

  • c# XML add an XML node as a child to a particular other node

    - by kacalapy
    I have an XML doc with a structure like this: <Book> <Title title="Door Three"/> <Author name ="Patrick"/> </Book> <Book> <Title title="Light"/> <Author name ="Roger"/> </Book> I want to be able to melodramatically add XML nodes to this XML in a particular place. Lets say I wanted to add a Link node as a child to the author node where the name is Roger. I think it's best if the function containing this logic is passed a param for the name to add an XML node under, please advise and what's the code I need to add XML nodes to a certain place in the XML? Now I am using .AppendChild() method but it doesn't allow for me to specify a parent node to add under...

    Read the article

  • c# Xml ADD A XML NODE AS A CHILD TO A PARTICULAR OTHER NODE

    - by kacalapy
    i have an xml doc with a structure like this: below is supposed to be XML but i dont know how to format it so it will show correct so i used [ ] instead of the typical < [Book] [Title title="Door Three"/] [Author name ="Patrick"/] [/Book] [Book] [Title title="Light"/] [Author name ="Roger"/] [/Book] i want to be able to PROGRAMMATICALY add xml nodes to this xml in a particular place. lets say i wanted to add a Link node as a child to the author node where the name is Roger (or whatever dynamic value is passed in here). i think its best if the function containing this logic is passed a param for the name to add an xml node under, please advise and whats the code i need to add xml nodes to a certain place in the xml? now i am using .AppendChild() method but it doesn't allow for me to specify a parent node to add under... thanks all.

    Read the article

  • Finding the maximum number of child nodes in a tree

    - by Jiminizer
    First, I should make it clear that this is required for an academic project. I am trying to find the maximum number of child nodes for any node in a tree, using Common Lisp. My current code is shown below - I'm not 100% on the logic of it, but I feel it should work, however it isn't giving me the required result. (defun breadth (list y) (setf l y) (mapcar #'(lambda (element) (when (listp element) (when (> (breadth element (length element)) l) (setf l (breadth element (length element))) ))) list) l) (defun max-breadth(list) (breadth list (length list)) ) As an example, running (max-breadth '(a ( (b (c d)) e) (f g (h i) j))) should return 4. Does anyone have any ideas where I'm going wrong? I suspect it's related to the second conditional, but I'm not sure.

    Read the article

  • Issue with child of custom Decorator class in WPF

    - by galacticgrug
    I need a custom border that renders a little differently than a normal border. I made a class that inherited from Decorator as follows class BetterBorder : Decorator { protected override Size ArrangeOverride(Size arrangeSize) { return arrangeSize; } protected override void OnRender(DrawingContext dc) { //these values are calculated elsewhere dc.DrawGeometry(backgroundBrush, borderPen, pathGeometry); } } //Properties and helper methods below this All of this works fine until I try to add a child to the control, the control can be added but is not visible and seems to be moved off BetterBorders visible client area. If I inherit from Border everything works fine, what am I missing?

    Read the article

  • Unable to remove master -> child subform links in microsoft access 2003

    - by Doug
    Hi, I am having an issue removing the master - child link fields in an access subreport data form. I have tried every avenue to remove them, using the properties window of the subreport as well as the link wizard. I have also deleted the subreport from the database and then gone as far as re-importing the existing objects into a new access instance. As soon as I re-added the subform back in and name it the same name the link fields show back up. Something is apparently corrupt, but I have run out of ideas at this point on how to clear them. Any Ideas would be appreciated. Thanks Doug

    Read the article

  • [WPF] SelectionChanged of a child ListBox

    - by quimbs
    Hi, I have a ListBox bound to an ObservableCollection with an ItemTemplate that contains another ListBox. First of all, I tried to get the last selected item of all the listboxes (either the parent and the inner ones) from my MainWindowViewModel this way: public object SelectedItem { get { return this.selectedItem; } set { this.selectedItem = value; base.NotifyPropertyChanged("SelectedItem"); } } So, for example, in the DataTemplate of the items of the parent ListBox I've got this: <ListBox ItemsSource="{Binding Tails}" SelectedItem="{Binding Path=DataContext.SelectedItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"/> The problem now, is that when I select an item from the parent ListBox and then an item from a child listbox, I get this: http://i40.tinypic.com/j7bvig.jpg As you can see, two items are selected at the same time. How can I solve that? Thanks in advance.

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >